-
Notifications
You must be signed in to change notification settings - Fork 0
Adding blocking_recv_with_timeout #171
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
Conversation
a08eb68 to
080231b
Compare
080231b to
3b5b149
Compare
| // on the log being pushed through the whole log processing pipeline. | ||
| let (tx, rx) = tokio::sync::oneshot::channel::<()>(); | ||
| (Some(tx), Some(rx)) | ||
| let bd_rx = bd_completion::Receiver::to_bd_completion_rx(rx); |
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.
This is a bit nasty but couldn't find a better way to handle proper receiver type without further refactors given LogLine is pub log_processing_completed_tx: Option<oneshot::Sender<()>>
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.
I would just change the type to use bd_completion in LogLine as well, seems like an appropriate usage of this type
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.
Got it, will give it a try
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.
Actually I gave this a try and requires major changes, functions like write_log, replay_log, process_log, etc will required to be updated as well. It seems a bit risky to do in this one. I can create a follow up task to consolidate all this tokio::sync::oneshot with bd_completion
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.
Added ticket here BIT-5624
| // on the log being pushed through the whole log processing pipeline. | ||
| let (tx, rx) = tokio::sync::oneshot::channel::<()>(); | ||
| (Some(tx), Some(rx)) | ||
| let bd_rx = bd_completion::Receiver::to_bd_completion_rx(rx); |
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.
I would just change the type to use bd_completion in LogLine as well, seems like an appropriate usage of this type
What
Resolves BIT-4913
This follow similar approach from @snowp in #125 and moves the time out logic as part of bd_completion
To avoid potentially blocking permanently on no network situations upon logger blocking calls adding timeout to those calls
See related doc
Verification
Steps
Temporary logs with airplane mode
See demo here https://drive.google.com/file/d/12ui3gyApvHdl37YGi4V6-36K-ZL41MQ0/view?usp=drive_link
Temporary logs with valid connection
See demo here https://drive.google.com/file/d/13ViBmsQDUjLb59iIqZjb3thWFMDuzi1O/view?usp=drive_link