-
Notifications
You must be signed in to change notification settings - Fork 81
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
Fancy service restart #2612
Fancy service restart #2612
Conversation
ProtocolConfiguration must remain the same, any errors mean that the signal will be ignored.
Most of the settings can't be changed, only services can.
Also fix addresses if needed and store this new configuration.
8b97407
to
09ffed8
Compare
Codecov Report
@@ Coverage Diff @@
## master #2612 +/- ##
==========================================
- Coverage 84.51% 84.35% -0.17%
==========================================
Files 299 300 +1
Lines 37882 38073 +191
==========================================
+ Hits 32016 32115 +99
- Misses 4458 4547 +89
- Partials 1408 1411 +3
Help us with your feedback. Take ten seconds to tell us how you rate us. |
c5dc439
to
6a85a63
Compare
orc, _ := o.Module.Load().(*OracleService) | ||
if orc == nil || *orc == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have a race condition, where all oracle services are restarted simultaneously and some requests are skipped?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably. The only way to solve it is to fetch currently active requests on service start, I'll take a look at it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the same problem for all currently active requests before node start now, they'll be completely ignored.
Or not exactly, it's way more involved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
OK, this can wait for 0.98.2, too many things touched and too many open questions. |
The only thing rpcsrv needs is AddResponse callback.
Which allows to enable/disable the service, change nodes, keys and other settings. Unfortunately, atomic.Value doesn't allow Store(nil), so we have to store a pointer there that can point to nil interface.
6a85a63
to
ad22ef6
Compare
It's a bit special since it's _always_ present to catch stateroots from the network.
Fix #1949. Also drop wallet from the ServerConfig since it's not used in any meaningful way after this change.
Now that services can come and go we need to protect all of the associated fields and allow to deregister them.
It has a stub for SIGHUP, but doesn't have anything for USR1 and USR2: Error: cli\server\server.go:520:31: undefined: syscall.SIGUSR1 Error: cli\server\server.go:521:31: undefined: syscall.SIGUSR2 Error: cli\server\server.go:565:17: undefined: syscall.SIGUSR1 Error: cli\server\server.go:608:17: undefined: syscall.SIGUSR2
Just log the error.
Move category definition from consensus to payload, consensus service is the one of its kind (HP), so network.Server can be adjusted accordingly.
ad22ef6
to
9b0ea2c
Compare
This fixes #1949. It works like this:
No config changes:
Enabled/disabled services: