Skip to content
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

op-batcher: Wait for queue to drain before shutdown #13172

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

mslipper
Copy link
Collaborator

@mslipper mslipper commented Dec 2, 2024

Tests are flaking because the batcher's txmgr still polls for receipts after shutdown. Those polls emit logs, which then cause the tests to panic. To fix, I updated the batcher shutdown code to wait for all pending transactions in the tx queue to complete.

Tests are flaking because the batcher's txmgr still polls for receipts after shutdown. Those polls emit logs, which then cause the tests to panic. To fix, I updated the batcher shutdown code to wait for all pending transactions in the tx queue to complete.
@mslipper mslipper requested review from a team as code owners December 2, 2024 17:18
@mslipper mslipper requested a review from sebastianst December 2, 2024 17:18
Copy link

codecov bot commented Dec 2, 2024

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 42.80%. Comparing base (9345537) to head (4d350e8).
Report is 19 commits behind head on develop.

Files with missing lines Patch % Lines
op-batcher/batcher/driver.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #13172      +/-   ##
===========================================
- Coverage    44.38%   42.80%   -1.59%     
===========================================
  Files          801      745      -56     
  Lines        72026    67364    -4662     
===========================================
- Hits         31972    28836    -3136     
+ Misses       37453    36097    -1356     
+ Partials      2601     2431     -170     
Flag Coverage Δ
cannon-go-tests-32 ?
cannon-go-tests-64 ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
op-batcher/batcher/driver.go 3.79% <0.00%> (-0.02%) ⬇️

... and 64 files with indirect coverage changes

@axelKingsley
Copy link
Contributor

Do you think we could make the tests permissive instead of making the TxMgr wait? We eliminated a lot of batcher waiting ~6mo ago because it doesn't need to wait (and in fact the waiting sometimes caused operational challenges in restart)

cc @sebastianst

@mslipper
Copy link
Collaborator Author

mslipper commented Dec 3, 2024

My comment was a bit misleading. The transactions won't actually be sent in the case of shutdown - the context gets cancelled, which will in turn cancel any pending sends. This just waits for the goroutines to exit, which will help with test stability and is a best practice.

@mslipper mslipper added this pull request to the merge queue Dec 3, 2024
Merged via the queue into develop with commit 622fb35 Dec 3, 2024
44 checks passed
@mslipper mslipper deleted the bugfix/batcher-shutdown branch December 3, 2024 18:21
sigma pushed a commit that referenced this pull request Dec 19, 2024
Tests are flaking because the batcher's txmgr still polls for receipts after shutdown. Those polls emit logs, which then cause the tests to panic. To fix, I updated the batcher shutdown code to wait for all pending transactions in the tx queue to complete.
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.

2 participants