GithubHelp home page GithubHelp logo

Potential segfault on server statup about nuraft HOT 3 CLOSED

ebay avatar ebay commented on July 22, 2024 1
Potential segfault on server statup

from nuraft.

Comments (3)

alesapin avatar alesapin commented on July 22, 2024

Also, I have a question. Is there any way from a user code to detect that the current server is ready to serve requests? By this, I mean that the server applied all uncommitted entries to its state machine and see the leader node or this node is the leader itself.
Seems like neither BecomeLeader nor BecomeFresh are not reliable ways to detect it.

from nuraft.

greensky00 avatar greensky00 commented on July 22, 2024

@alesapin
There is is_initialized() API to check if the Raft is ready (either it becomes leader or receives the first heartbeat from the existing leader). But that won't be the case for you if your background thread is doing something with raft_server before the constructor is done. We also internally use an atomic flag, running for example:

raftServer = cs_new<raft_server>(ctx, i_opt);
...
running = true;

but that is not the part of Raft. I think your PR #195 seems reasonable to avoid the issue without maintaining external flags.

from nuraft.

alesapin avatar alesapin commented on July 22, 2024

Thanks, let's close this one.

from nuraft.

Related Issues (20)

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.