apollo_propeller: wake poll from on_behaviour_event#13334
Conversation
a4dd663 to
8969808
Compare
guy-starkware
left a comment
There was a problem hiding this comment.
@guy-starkware reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on ShahakShama and sirandreww-starkware).
crates/apollo_propeller/src/handler.rs line 507 at r1 (raw file):
// Store the waker so on_behaviour_event / on_connection_event can wake us. // Only clone when we're actually going to sleep (Pending), and skip if unchanged. if result.is_pending() && !self.waker.as_ref().is_some_and(|w| w.will_wake(cx.waker())) {
I'm not going to block you on this, and honestly I don't know what you can do... but this conditional (starting with the !) is not super readable. Don't spend too much time on it though...
ShahakShama
left a comment
There was a problem hiding this comment.
@ShahakShama reviewed all commit messages and made 1 comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on sirandreww-starkware).
crates/apollo_propeller/src/handler.rs line 507 at r1 (raw file):
// Store the waker so on_behaviour_event / on_connection_event can wake us. // Only clone when we're actually going to sleep (Pending), and skip if unchanged. if result.is_pending() && !self.waker.as_ref().is_some_and(|w| w.will_wake(cx.waker())) {
What's the harm if we always store the waker? Say both to me and to the comment
8969808 to
8dda1ff
Compare
157edb8 to
8b50eb8
Compare
8dda1ff to
e58cba4
Compare
8b50eb8 to
72c2036
Compare
e58cba4 to
82f7eb8
Compare
72c2036 to
098fdef
Compare
82f7eb8 to
f340c33
Compare
f340c33 to
c6fe4d2
Compare
ba9df14 to
d947c62
Compare
PR SummaryMedium Risk Overview Also wakes the handler after Reviewed by Cursor Bugbot for commit 8b47ad3. Bugbot is set up for automated code reviews on this repo. Configure here. |
c6fe4d2 to
f597519
Compare
sirandreww-starkware
left a comment
There was a problem hiding this comment.
@sirandreww-starkware made 2 comments.
Reviewable status: 0 of 1 files reviewed, 2 unresolved discussions (waiting on guy-starkware and ShahakShama).
crates/apollo_propeller/src/handler.rs line 507 at r1 (raw file):
Previously, guy-starkware wrote…
I'm not going to block you on this, and honestly I don't know what you can do... but this conditional (starting with the !) is not super readable. Don't spend too much time on it though...
Simplified — now always store the waker, dropping the conditional entirely. Wakers are cheap Arc clones, so the optimization wasn't worth the readability cost.
crates/apollo_propeller/src/handler.rs line 507 at r1 (raw file):
Previously, ShahakShama wrote…
What's the harm if we always store the waker? Say both to me and to the comment
No harm — Waker is Arc-backed so clone() is just a refcount bump. Switched to unconditionally storing the waker and trimmed the comment to match.
ShahakShama
left a comment
There was a problem hiding this comment.
@ShahakShama reviewed 1 file and all commit messages, made 2 comments, and resolved 1 discussion.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on guy-starkware, ShahakShama, and sirandreww-starkware).
crates/apollo_propeller/src/handler.rs line 76 at r2 (raw file):
/// Maximum wire message size for batching. max_wire_message_size: usize, /// The most recent waker from [`ConnectionHandler::poll`], used to wake the task when new
used to sounds like it used to but it isn't now
I think used for waking is the best but maybe there are other better options
f597519 to
1eb7249
Compare
Merge activity
|
1eb7249 to
b55aebe
Compare
b55aebe to
8b47ad3
Compare
sirandreww-starkware
left a comment
There was a problem hiding this comment.
@sirandreww-starkware reviewed 1 file and all commit messages, and resolved 2 discussions.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on sirandreww-starkware).

Note
Low Risk
Small, localized change to async wakeup behavior in the connection handler; primary risk is unintended extra wakeups or missed wakeups if waker handling is incorrect.
Overview
The Propeller
ConnectionHandlernow caches the latest taskWakerfrompolland explicitly wakes it when new messages are enqueued viaon_behaviour_event.It also wakes the handler after
DialUpgradeErrorhandling (after resetting outbound state / clearing the send queue) so the connection can promptly progress without waiting for an external poll.Written by Cursor Bugbot for commit f340c33. This will update automatically on new commits. Configure here.