Skip to content

Remove immediate timer reset.#4323

Open
twittner wants to merge 1 commit into
mainfrom
tw/rm-app-level-timeout-retry
Open

Remove immediate timer reset.#4323
twittner wants to merge 1 commit into
mainfrom
tw/rm-app-level-timeout-retry

Conversation

@twittner
Copy link
Copy Markdown
Contributor

@twittner twittner commented May 18, 2026

Messages are reliably delivered until garbage collection. Additional retries may just fill up the outbound message buffers of peers.

Change Timer to fire only once to avoid repeated timeouts. Thus after a timer expires it needs to be reset to make it fire again.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 18, 2026

Claude finished @twittner's task in 3m 49s —— View job


Code Review

  • Gather context and read the diff
  • Check existing review comments
  • Review the change
  • Post review

Summary

This PR removes the self.timer.reset() call that previously re-armed the timer after a timeout, with the intent of stopping redundant timeout vote retries since the messaging layer already guarantees delivery.

The motivation is sound, but the current implementation has a critical issue: a completed tokio::time::Sleep returns Poll::Ready(()) on every subsequent poll, which means the timer branch in the select! loop will fire continuously in a tight loop rather than just once. This would flood the network with duplicate timeout votes at CPU speed and starve the other select! branches — the exact opposite of the intended effect.

See the inline comment for details and suggested fixes.

Additionally, after this change Timer::reset() and Timer::reset_with() become dead code (only reset_with_epoch() is still called at line 618).

Comment thread crates/hotshot/new-protocol/src/coordinator.rs
Messages are reliably delivered until garbage collection. Additional
retries may just fill up the outbound message buffers of peers.

Change `Timer` to fire only once to avoid repeated timeouts. Thus after
a timer expires it needs to be reset to make it fire again.
@twittner twittner force-pushed the tw/rm-app-level-timeout-retry branch from 0600cbe to 177e77f Compare May 18, 2026 15:30
@twittner
Copy link
Copy Markdown
Contributor Author

@claude: review once

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 18, 2026

Claude encountered an error after 57s —— View job


Code Review

  • Gather context and read the diff
  • Review the timer implementation
  • Review the coordinator changes
  • Post review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant