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

dvovk/headers info #9748

Merged
merged 10 commits into from
Apr 8, 2024
Merged

dvovk/headers info #9748

merged 10 commits into from
Apr 8, 2024

Conversation

dvovk
Copy link
Member

@dvovk dvovk commented Mar 18, 2024

  • collecting info for "Headers" stage

@dvovk dvovk requested review from mh0lt, shohamc1 and AskAlexSharov and removed request for mh0lt and shohamc1 March 18, 2024 20:32
ctx, ch, cancel := Context[HeaderCanonicalMarkerUpdate](context.Background(), 1)
defer cancel()

rootCtx, _ := common.RootContext()
Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. common.RootContext() - it's not global variable access - it's constructor. and better don't have more than 1 root context.
    please pass existing root context to DiagnosticClient constructor. save it as field and use here.
    (feel free to rename RootContext to NewRootContext)

  2. cancel 1 context based on another one - it's anti-pattern:

case <-rootCtx.Done():
				cancel()

better establish child-parent relationship between contexts: Context[HeaderCanonicalMarkerUpdate](context.Background() -> Context[HeaderCanonicalMarkerUpdate](rootCtx

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Copy link

sonarcloud bot commented Mar 29, 2024

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@dvovk dvovk merged commit 70406e6 into devel Apr 8, 2024
7 checks passed
@dvovk dvovk deleted the dvovk/headers_info branch April 8, 2024 18:45
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.

None yet

2 participants