-
Notifications
You must be signed in to change notification settings - Fork 844
Another option to fix potential HTTP/2 vio stall #6409
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
Another option to fix potential HTTP/2 vio stall #6409
Conversation
|
[ci approve clang-analyzer] |
1 similar comment
|
[ci approve clang-analyzer] |
| if (this->_write_vio_event) { | ||
| this->_write_vio_event->cancel(); | ||
| } | ||
| this->_write_vio_event = this_ethread()->schedule_in(this, retry_delay, event, &write_vio); |
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.
If I understand this correctly, we don't need to pass write_vio because it always use THE write_vio that Http2Stream has, right?
Is retry_delay required? Should we change signal_read_event to use it too (on maybe another PR)?
Edit: I found signal_read_event already use retry_delay on this PR.
masaori335
left a comment
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.
If we need an async mechanism, rescheduling events to itself like this is an option.
Actually, I doubt the necessaries of the async mechanism, but we can deal with it later.
| reentrancy_count++; | ||
| if (e == cross_thread_event) { | ||
| if (e == _read_vio_event) { | ||
| this->signal_read_event(e->callback_event); |
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.
It's better to set _read_vio_event nullptr before signal_read_event() call. Otherwise, _read_vio_event->cancel() will be called when the mutex could not be locked again.
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.
[nitpicking] e->callback_event is same to event, right? Using event looks clear in these event handlers.
maskit
left a comment
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 prefer this approach rather than #6367 because it looks safer.
|
[approve ci clang-analyzer] |
|
Cherry-picked to v9.0.x branch. |
Another approach to address the issue identified in PR #6367. This PR does reschedule in the event that the continuation lock is unavailable. But it schedules to itself rather than to the continuation. At the top of the Http2Stream main handler, it looks for the read and write_vio events and attempts to call the read or write handler again using the event stored away in in the event's callback event.