-
Notifications
You must be signed in to change notification settings - Fork 11
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
fix: ensure storages are force flushed during uplink shutdown #311
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* feat: force serializer into crash mode on shutdown * log: writing incoming data into persistence * fix: pull pending requests from channel
* feat: force flush non-overflowed in-memory buffers * fix: increase shutdown period NOTE: necessary for safely handling force flush to disk * log: successful force flush * doc: update comment * fix: `try_recv` to trigger storage flush NOTE: needs to be verified for any realistic possibility of data loss * fix: ignore empty buffers * fix: write not read buffer * fix: ignore empty write buffers * fix: wait max 2 secs for data flushed from bridge
de-sh
pushed a commit
that referenced
this pull request
Dec 10, 2023
Code to ease readability of control handles as requested by @tekjar is included in the PR #316 and this commit |
tekjar
reviewed
Jan 4, 2024
tekjar
reviewed
Jan 4, 2024
@@ -200,7 +200,7 @@ fn main() -> Result<(), Error> { | |||
uplink.resolve_on_shutdown().await.unwrap(); | |||
info!("Uplink shutting down..."); | |||
// NOTE: wait 5s to allow serializer to write to network/disk | |||
sleep(Duration::from_secs(5)).await; | |||
sleep(Duration::from_secs(10)).await; |
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.
Make shutdown reactive/synchronous in a separate PR
de-sh
pushed a commit
that referenced
this pull request
Jan 4, 2024
* changes by vilayat * changes by vilayat * fix: basic implementation fixes, needs debugging * doc: note on where to load inflight publishes * fix: `EventLoop::clean` to force persist inflight * chore: cleanup * doc: remove outdated comments * doc: don't disconnect, note why * chore: rm unused loc * feat: load saved inflight publishes on uplink restart (#307) * Implemeted reading from disk and publishing onto the network * inflight persistence logic * doc: make the code readable --------- Co-authored-by: Devdutt Shenoi <devdutt@bytebeam.io> * chore: revert unrelated changes * doc: make it clear what is happening * doc: replace commented out code with TODO * fix: `Error=PacketIdZero` * chore: cargo update * fix: handle incoming data during inflight recovery * doc: describe undesired behavior * refactor: DRY `PersistenceFile` * log: add condition for successful completion * doc: improve comments in `recovery` * refactor: improve readability with placement * fix: merge breaking code * doc: code improvement TODO based on #311 * feat: `Ctrl` handles for `Mqtt` * refactor: remove code that never gets hit * refactor: load pending packets into eventloop * fix: delete file once read * refactor: error handling in recovery * fix: glienicke bridge to limit inflight growth * refactor: unnecessary copy * style: don't log before success * log: make sense * fix: save pending files from getting lost * fix: `VecDeque` to maintain order * doc: revert update to illustration * style: remove whitespace * rm: unused directories * chore: use main rumqtt * doc: update note * fix: don't change pkid of inflight * log: improve messaging * style: make it obvious --------- Co-authored-by: vilayat-ali <vilayatcodemysite@gmail.com> Co-authored-by: Syed Vilayat Ali Rizvi <73014428+Vilayat-Ali@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #
Changes
Why?
Storage might contain publishes that aren't enough to overflow from in-memory buffer onto disk, in this situation, during shutdown, uplink must force them to be written into file to save them from being lost.
Trials Performed
Consult linked PRs for more detail