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

Enable noctx lint #9350

Closed
wants to merge 2 commits into from
Closed

Conversation

matejvasek
Copy link
Contributor

@matejvasek matejvasek commented Feb 12, 2021

This improves context propagation which might be useful for cancellation of running processes.

For example a user call some /libpod/ RESTful endpoint, and the handler of the endpoint itself does some other HTTP request.
If the user cancels the HTTP request to the /libpod API (i.e. closes TCP connection), the HTTP request invoked by the handler will be also cancelled now.

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: matejvasek
To complete the pull request process, please assign edsantiago after the PR has been reviewed.
You can assign the PR to them by writing /assign @edsantiago in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@matejvasek matejvasek force-pushed the enable_ctx_lint branch 3 times, most recently from 8831eba to 37a5d67 Compare February 12, 2021 23:18
@TomSweeneyRedHat
Copy link
Member

@matejvasek
Changes LGTM, but could you add a little description to the PR for historical purposes?

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

The PR is changing a lot of internal interfaces while the value (besides making the linter happy) is rather unclear to me. The biggest benefit of using a Context that I know is that it allows for cancelling go routines (if they support it) but I don't think that's the case in the proposed changes.

In case others feel different, I want to encourage to delay merging this PR for a couple of weeks. v3.0.0 just went out the door and merging the PR is likely causing conflicts when backporting from the main to the v3.0 branch. I think we'll be fixing some more bugs once 3.0 hits more users.

@matejvasek
Copy link
Contributor Author

The biggest benefit of using a Context that I know is that it allows for cancelling go routines (if they support it) but I don't think that's the case in the proposed changes.

@vrothberg In this case it should allow to cancel some ongoing HTTP requests.
Question is if those HTTP can be so long running it's worth doing it.

@matejvasek
Copy link
Contributor Author

If we wanted just make linter happy we could simply pass context.TODO().

@matejvasek
Copy link
Contributor Author

But of course this is not super important and don't not need to be merge soon.

@matejvasek
Copy link
Contributor Author

matejvasek commented Feb 13, 2021

@vrothberg Imagine you call /libpod/images/import (and you use the URL parameter instead of body as a source). But then you think "Oh that's not I want to do!" and you cancel the request (close the connection) the download process will continue. I believe I might have even seen that happening. Of course this is not necessarily bad.

@matejvasek
Copy link
Contributor Author

I believe I might have even see that happening.

Once I cancelled some request but saw server continuing with work. But I am not sure that it was image import operation.

@vrothberg
Copy link
Member

@vrothberg Imagine you call /libpod/images/import (and you use the URL parameter instead of body as a source). But then you think "Oh that's not I want to do!" and you cancel the request (close the connection) the download process will continue. I believe I might have even seen that happening. Of course this is not necessarily bad.

(More) cancellable remote calls would be an improvement. In case of import, it would fail immediately since the client uploads the data but there are other cases like pull where it would be nice to have.

@matejvasek
Copy link
Contributor Author

matejvasek commented Feb 14, 2021

In case of import, it would fail immediately since the client uploads the data but there are other cases like pull where it would be nice to have.

From source code it looks like client don't have to necessarily upload data. It is possible to use query parameter named URL, if the parameter is used then data will be downloaded from there.

@matejvasek
Copy link
Contributor Author

Flake again.

@vrothberg
Copy link
Member

/hold

Holding the merge since I am still rather objecting to merge. If we want to, please wait a while until v3.0 further stabilized to avoid additional work for backports.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 15, 2021
@rhatdan
Copy link
Member

rhatdan commented Feb 15, 2021

Yes let's wait for a while before merging. Would like to get @mheon Thoughts on this as well.

@mheon
Copy link
Member

mheon commented Feb 15, 2021 via email

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 24, 2021
@openshift-ci-robot
Copy link
Collaborator

@matejvasek: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@rhatdan
Copy link
Member

rhatdan commented Feb 27, 2021

@matejvasek Please rebase.

@github-actions
Copy link

A friendly reminder that this PR had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Mar 30, 2021

@matejvasek What do you want to do with this PR?

@rhatdan
Copy link
Member

rhatdan commented May 6, 2021

Since we have had no movement on this PR in a month, I am going to close. @matejvasek reopen if you still want to add it.

@rhatdan rhatdan closed this May 6, 2021
@matejvasek
Copy link
Contributor Author

@rhatdan I think that at this point rebase would be difficult anyway, rewrite might be easier if we really want these changes.

@rhatdan
Copy link
Member

rhatdan commented May 7, 2021

You tell me if you think they are valuable.

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. stale-pr
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants