GoogleChrome / GoogleChrome/ripunzip

possibility of an indefinite while loop when https stream reader thread notifies and the other thread has not yet read the condVar

Open
#102 14 comments 0 reactions 1 assignee Claimed by @pgrace-google View on GitHub
Dominant language
Rust
Stars
294
Forks
30
PR merge metrics
No merged PRs in 30d

Description

Suppose a scenario, where we have 2 threads doing the read operation,

it is possible that when the thread has errored out, in say `read_exact` method, now when it tries to notify the other thread, it is possible that the other thread is somewhere between while loop and claiming the cache mutex, so the notification is missed,

![Image](https://github.com/user-attachments/assets/46b00436-da3b-458f-9e7d-496f07a12d35)

and since it errored out in `read_exact`, it has not set the state.reader to the right state and is None, which can potentially cause missed notification and an indefinite while loop.

we should also add retries in case we face the issue when doing `read_exact`, especially if the error is Interrupted or UnexpectedEOF.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.