-
Notifications
You must be signed in to change notification settings - Fork 87
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
Handle exiting threads in diffusion layer #2696
Conversation
8de93a9
to
fe8f818
Compare
Fixes #2684 . |
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.
LGTM
@@ -319,9 +327,10 @@ runDataDiffusion tracers | |||
sd | |||
(daLocalResponderApplication applications) | |||
localErrorPolicy | |||
return () |
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.
Do we need this return
? There's void
applied to previous monadic action.
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.
No, the return
isn't needed. Will remove it.
@@ -350,11 +359,12 @@ runDataDiffusion tracers | |||
sd | |||
(daResponderApplication applications) | |||
remoteErrorPolicy | |||
return () |
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.
The same here.
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.
Same reply ;)
@@ -369,13 +379,13 @@ runDataDiffusion tracers | |||
, spErrorPolicies = remoteErrorPolicy | |||
, spSubscriptionTarget = daIpProducers | |||
} | |||
(daInitiatorApplication applications) | |||
(daInitiatorApplication applications) >> return () |
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 would be cleaner to write:
void $ NodeToNode.ipSubscriptionWorker ...
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.
👍
@@ -391,7 +401,7 @@ runDataDiffusion tracers | |||
, spErrorPolicies = remoteErrorPolicy | |||
, spSubscriptionTarget = dnsProducer | |||
} | |||
(daInitiatorApplication applications) | |||
(daInitiatorApplication applications) >> return () |
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.
The same here.
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.
👍
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.
Some minor comments.
If a thread spawned by diffusion exits for any reason we kill all other threads and return. This is done to ensure that the node isn't left running in a semi-functional state, for example with the client side working but the server has exited due to a configuration error.
fe8f818
to
049c989
Compare
This should fix #2519 too. |
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.
LGTM
bors r+ |
Build succeeded: |
2696: Handle exiting threads in diffusion layer r=karknu a=karknu If a thread spawned by diffusion exits for any reason we kill all other threads and return. This is done to ensure that the node isn't left running in a semi-functional state, for example with the client side working but the server has exited due to a configuration error. Example output: `cardano-node: Network.Socket.bind: unsupported operation (Can't assign requested address)⏎` Co-authored-by: Karl Knutsson <karl.knutsson@iohk.io>
If a thread spawned by diffusion exits for any reason we kill
all other threads and return. This is done to ensure that the node isn't
left running in a semi-functional state, for example with the client
side working but the server has exited due to a configuration error.
Example output:
cardano-node: Network.Socket.bind: unsupported operation (Can't assign requested address)⏎