-
Notifications
You must be signed in to change notification settings - Fork 45
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
Consider shutdown signal during entire signer loop #936
Conversation
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 and I tested it successfully!
We should follow up with a PR to Greenlight.
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. Solves the shutdown issue after interacting with the signer
As discussed, I separated the scheduler loop from the signer loop, such that calls to PR is ready for final review. |
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
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
* Consider shutdown signal during entire signer loop * Cargo fmt * Add comments to run_forever_inner() * Separate scheduler and signer loop
* commit 'b08215dc4fa98cadb50616a3702bc8f83afaf636': Fix indentation on CHANGELOG.md Update sdk-flutter plugin changelogs Update version to 0.4.0 Change the redeem swap failure notification to prompt to open the app Update version to 0.4.0-rc5 Move notification source files and change podspecs/package Consider shutdown signal during entire signer loop (#936) Update version to 0.4.0-rc4 Merge Swift package sources into one BreezSDK target Update version to 0.4.0-rc3 upgrade version to 0.4.0-rc2 Add a service timeout to the android notification plugin Pre-check for a valid notification manager before starting the foreground service temporary skip c# tests Fix csharp test connect request fix test to use production environment update versions to 0.4.0
Before this PR, the signer loop consisted of
signer.run_once
is not running, which may take 10 minutes to return. In other words, in the worst case the shutdown signal is handled (e.g. signer loop exits) 10 minutes after it's sent.This PR wraps both loops above in a single
run_forever_inner
thread. In parallel to it, it listens to the shutdown signal and exits the thread as soon as the signal is received.Possibly overrides #934.
Note to reviewers / Open question
I'm not sure if the signer upgrade loop (
scheduler.maybe_upgrade
) should be interrupted in the case of an upgrade. WIth this PR, it would be interrupted if we get a shutdown signal.On the other hand, as described in #934, if we disregard the shutdown signal while we're in the signer upgrade loop, we may end up in an endless loop in the case when the GL scheduler is not reachable.
What do you think? How to best handle the upgrade loop?