-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
make load trigger fire and forget #16508
Conversation
lggr.Infow("load finished, waiting before stopping transmit watcher", | ||
"srcChain", srcChainSel) | ||
go func() { | ||
time.Sleep(tickerDuration) |
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.
Why sleep instead of using a ticker? Also what's the benefit of sleeping in a Go routine?
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.
Use a goroutine here to not block the main switch case statement. We want that to continue checking for transmits during this sleep time.
Using a ticker lets us check if load is done every cycle. If the end of the cycle corresponds with the end of the ticker, it's possible to miss a slow transmit
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.
Why not just use the loadFinished instead of endChannel then in the loop below? and once you hit it wait for a tick and then do the logic.
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 had that implementation initially, but doing it that way runs into an edge case where the ticker and loadFinished execute at the same time, which might miss a slow transmit.
I took another look at it and added the time.Sleep one level up in ccip_test to make it simpler to understand
|
* parallelize operations in the deployer group * enable replacing ocr only * update metrics manager * metric changes wip * allow load test to fire and forget * cleanup unused channels, better channel closing * revert temp change * Add test label value * update ocr values, respond to comments * goimports
Requires
Supports