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

feat: rm interceptors and use context #252

Merged
merged 6 commits into from
Dec 24, 2024
Merged

feat: rm interceptors and use context #252

merged 6 commits into from
Dec 24, 2024

Conversation

Lazar955
Copy link
Member

@Lazar955 Lazar955 commented Dec 24, 2024

This PR removes the usage of signal.Interceptor and uses Go's idiomatic context to handle cancellations. This enables us to run e2e tests in parallel (almost 4x faster).

//old-time
ok      github.com/babylonlabs-io/finality-provider/itest       548.976s
// new time
ok      github.com/babylonlabs-io/finality-provider/itest       139.579s

Time in GH action 9m 58s vs 3m 24s

Closes #219

Copy link
Member

@gitferry gitferry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

Comment on lines 99 to 101
// Wait for shutdown signal from either a graceful server stop or from
// the interrupt handler.
<-s.interceptor.ShutdownChannel()
// <-s.interceptor.ShutdownChannel()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leftover

Comment on lines 97 to 100
// Wait for shutdown signal from either a graceful server stop or from
// the interrupt handler.
<-s.interceptor.ShutdownChannel()
// <-s.interceptor.ShutdownChannel()
<-ctx.Done()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leftover

Copy link
Contributor

@RafilxTenfen RafilxTenfen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Lazar955 Lazar955 merged commit d7059e0 into main Dec 24, 2024
12 checks passed
@Lazar955 Lazar955 deleted the lazar/use-context branch December 24, 2024 15:59
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.

Remove interceptors, use context for cancellation
3 participants