Conversation
This avoids warnings like the following: ``` WARN dbsp::storage::backend::posixio_impl: /pipeline-storage/status.json.mut: unable to delete dropped file: No such file or directory (os error 2) WARN dbsp_adapters::server: status.json: failed to write to storage (/pipeline-storage/status.json.mut: rename failed: entity not found) ``` which occurred because the task to update status.json would start an update before waiting for the previous one to complete. Signed-off-by: Ben Pfaff <blp@feldera.com>
mihaibudiu
approved these changes
Feb 4, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Serializes status.json writes by awaiting the prior blocking write task, preventing overlapping updates that caused rename/delete race warnings.
Changes:
- Await the
spawn_blockingtask responsible for writingstatus.jsonso updates don’t overlap.
| if Some(stored_status) != prev_stored_status { | ||
| let storage = storage.clone(); | ||
| spawn_blocking(move || stored_status.write(&*storage)); | ||
| let _ = spawn_blocking(move || stored_status.write(&*storage)).await; |
There was a problem hiding this comment.
Awaiting the task prevents the race (good), but the result is discarded, which can hide a panic in the blocking task (JoinError) and any error returned by stored_status.write(...) (if it returns a Result). Consider handling the awaited result explicitly (e.g., log JoinError and/or the write error) so failures to persist status don’t silently pass.
Suggested change
| let _ = spawn_blocking(move || stored_status.write(&*storage)).await; | |
| if let Err(join_err) = | |
| spawn_blocking(move || stored_status.write(&*storage)).await | |
| { | |
| eprintln!( | |
| "failed to persist stored status: blocking task panicked or was cancelled: {join_err}" | |
| ); | |
| } |
This file contains hidden or 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
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.
This avoids warnings like the following:
which occurred because the task to update status.json would start an update before waiting for the previous one to complete.
Checklist
Breaking Changes?
Mark if you think the answer is yes for any of these components:
Describe Incompatible Changes