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

Cancel request's context when request processed #884

Merged
merged 6 commits into from
Jul 13, 2022

Conversation

rumyantseva
Copy link
Member

@rumyantseva rumyantseva commented Jul 13, 2022

Description

This PR proposes using contexts with cancellation to process requests.

Readiness checklist

  • I added tests for new functionality or bugfixes.
  • I ran task all, and it passed.
  • I added/updated comments for both exported and unexported top-level declarations (functions, types, etc).
  • I checked comments rendering with task godocs.
  • (for maintainers only) I set Reviewers, Assignee, Labels, Project and project's Sprint fields.
  • I marked all done items in this checklist.

@rumyantseva rumyantseva requested a review from a team July 13, 2022 11:56
@rumyantseva rumyantseva requested a review from a team as a code owner July 13, 2022 11:56
@rumyantseva rumyantseva requested a review from AlekSi July 13, 2022 11:56
@rumyantseva rumyantseva self-assigned this Jul 13, 2022
@rumyantseva rumyantseva added the code/chore Code maintenance improvements label Jul 13, 2022
w84thesun
w84thesun previously approved these changes Jul 13, 2022
@rumyantseva rumyantseva requested review from a team, seeforschauer and noisersup and removed request for a team July 13, 2022 11:59
seeforschauer
seeforschauer previously approved these changes Jul 13, 2022
@codecov
Copy link

codecov bot commented Jul 13, 2022

Codecov Report

Merging #884 (2167e34) into main (deb063f) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #884      +/-   ##
==========================================
- Coverage   59.10%   59.07%   -0.03%     
==========================================
  Files         219      219              
  Lines       10028    10029       +1     
==========================================
- Hits         5927     5925       -2     
- Misses       3403     3405       +2     
- Partials      698      699       +1     
Impacted Files Coverage Δ
internal/clientconn/conn.go 47.34% <100.00%> (+0.20%) ⬆️
internal/util/version/version.go 55.00% <0.00%> (-5.00%) ⬇️
Flag Coverage Δ
integration 61.30% <100.00%> (-0.04%) ⬇️
mongodb 18.58% <100.00%> (-0.03%) ⬇️
pg 61.23% <100.00%> (-0.04%) ⬇️
unit 24.75% <0.00%> (-0.04%) ⬇️

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

seeforschauer
seeforschauer previously approved these changes Jul 13, 2022
@rumyantseva rumyantseva changed the title Use separate context for each request Use a separate context for each request Jul 13, 2022
noisersup
noisersup previously approved these changes Jul 13, 2022
Copy link
Member

@noisersup noisersup left a comment

Choose a reason for hiding this comment

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

LGTM

w84thesun
w84thesun previously approved these changes Jul 13, 2022
Copy link
Contributor

@w84thesun w84thesun left a comment

Choose a reason for hiding this comment

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

LGTM

internal/clientconn/conn.go Outdated Show resolved Hide resolved
internal/clientconn/conn.go Outdated Show resolved Hide resolved
@rumyantseva rumyantseva dismissed stale reviews from w84thesun and noisersup via c00b005 July 13, 2022 12:51
@rumyantseva rumyantseva changed the title Use a separate context for each request Cancel context when request processed Jul 13, 2022
@rumyantseva rumyantseva changed the title Cancel context when request processed Cancel request's context when request processed Jul 13, 2022
@AlekSi AlekSi enabled auto-merge (squash) July 13, 2022 12:55
@AlekSi AlekSi merged commit b2544c6 into FerretDB:main Jul 13, 2022
@AlekSi AlekSi added this to the v0.5.1 milestone Jul 19, 2022
@rumyantseva rumyantseva deleted the router-context-cancellation branch August 8, 2022 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/chore Code maintenance improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants