Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start RPC server earlier, add pipes for parent process IPC. #308

Closed
wants to merge 2 commits into from

Conversation

jrick
Copy link
Member

@jrick jrick commented Aug 9, 2016

The RPC server is now the first subsystem that is started. Because
the RPC server would not be usable without the rest of the subsystems
running, all requests are disabled until bringup has finished. This
has the added benefit of erroring earlier if the RPC listeners can not
be created.

Rewrite startup/shutdown logic to simplify shutdown signaling. All
cleanup is now run from deferred functions in the main function.

Add two new config options to set the read and write ends of a pair of
pipes. This is used as a simple mechanism for a parent process to
communicate with, observe, and manage the lifetime of a child dcrd
process. When the RX (read end) pipe is closed, clean shutdown
automatically begins.

Add a new flag --lifetimeevents to create and send lifetime event
notifications over the TX (write end) pipe during bringup and
shutdown. This allows the parent process to observe which subsystems
are currently starting, running, and stopping.

Fixes #297.
Fixes #298.

@jrick
Copy link
Member Author

jrick commented Aug 9, 2016

Looking over my diff again I realized that the RPC server should also produce errors after shutdown has begun, just as it does before startup completes.

jrick added 2 commits August 9, 2016 11:54
The RPC server is now the first subsystem that is started.  Because
the RPC server would not be usable without the rest of the subsystems
running, all requests are disabled until bringup has finished.  This
has the added benefit of erroring earlier if the RPC listeners can not
be created.

Rewrite startup/shutdown logic to simplify shutdown signaling.  All
cleanup is now run from deferred functions in the main function.

Add two new config options to set the read and write ends of a pair of
pipes.  This is used as a simple mechanism for a parent process to
communicate with, observe, and manage the lifetime of a child dcrd
process.  When the RX (read end) pipe is closed, clean shutdown
automatically begins.

Add a new flag --lifetimeevents to create and send lifetime event
notifications over the TX (write end) pipe during bringup and
shutdown.  This allows the parent process to observe which subsystems
are currently starting, running, and stopping.

Fixes btcsuite#297.
Fixes btcsuite#298.
@alexlyp
Copy link
Member

alexlyp commented Aug 9, 2016

actually nACK, something goofy is going on with wallet connection and rpc calls to wallet that use chainClient requests as well (like getstakeinfo)

@jrick
Copy link
Member Author

jrick commented Aug 9, 2016

Closing this PR and will open a new one that reverts the changes to the RPC server and startup/shutdown ordering. The pipes give us everything we need for the launcher.

@jrick jrick closed this Aug 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shutdown dcrd.exe via RPC Lanch RPC server earlier during bring-up
2 participants