Coder Social home page Coder Social logo

alibaba / redalert Goto Github PK

View Code? Open in Web Editor NEW
62.0 15.0 26.0 9.54 MB

RedAlert is a monitor service, which fetches metrics from service like ganglia and graphite. It finds abnormal among metrics and raise alarm via email.

License: GNU General Public License v2.0

Python 20.36% Shell 5.29% C++ 5.89% CMake 0.68% C 43.10% Makefile 10.35% M4 2.85% Roff 2.40% HTML 3.96% Perl 2.02% Visual Basic 0.05% Assembly 0.02% Awk 0.02% DIGITAL Command Language 1.09% Perl 6 0.04% Batchfile 0.01% CSS 0.15% JavaScript 1.59% Ruby 0.12% Erlang 0.01%

redalert's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redalert's Issues

Potential Data Race in HeartbeatClient

Hi,

Our code scanner has reported a data race at workLoop method of HeartbeatClient

bool HeartbeatClient::start() {
    int err = pthread_create(&_thread, NULL, &HeartbeatClient::workLoop, this);
    if (err != 0) {
        LOG(ERROR) << "Cannot start thread for heartbeat client";
        return false;
    }
    _running = true;
    LOG(INFO) << "Start sending heartbeats to '" << _remoteHost << ":" << _remotePort << "'";
    return true;
}

_running initialized with false,
Could there is a chance that HeartbeatClient::workLoop access the _running before the main thread has assigned true into, the heart beat thread might just stopped before the main thread has updated the value of _running.

May be we could move the assignment into thread body to avoid this issue.

void* HeartbeatClient::workLoop(void *arg) {
   ......
    // client->_running = true;                 // <======    move here instead 
    while (client->_running) {

Regards,
Alex, SourceBrella Inc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.