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

make load trigger fire and forget #16508

Merged
merged 12 commits into from
Feb 24, 2025
Merged

make load trigger fire and forget #16508

merged 12 commits into from
Feb 24, 2025

Conversation

0xAustinWang
Copy link
Contributor

Requires

Supports

@0xAustinWang 0xAustinWang requested review from a team as code owners February 21, 2025 06:19
@0xAustinWang 0xAustinWang changed the title Aw/metric manager make load trigger fire and forget Feb 21, 2025
mateusz-sekara
mateusz-sekara previously approved these changes Feb 21, 2025
lggr.Infow("load finished, waiting before stopping transmit watcher",
"srcChain", srcChainSel)
go func() {
time.Sleep(tickerDuration)
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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.

Copy link
Contributor Author

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

@0xAustinWang 0xAustinWang added this pull request to the merge queue Feb 24, 2025
Merged via the queue into develop with commit 855c2a7 Feb 24, 2025
183 checks passed
@0xAustinWang 0xAustinWang deleted the aw/metricManager branch February 24, 2025 08:51
krehermann pushed a commit that referenced this pull request Feb 27, 2025
* 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
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.

3 participants