tektoncd / results

Long term storage of execution results.
Apache License 2.0
77 stars 73 forks source link

Make sure gRPC connection is closed #625

Closed stuartwdouglas closed 12 months ago

stuartwdouglas commented 1 year ago

Changes

In the error case the gRPC stream is closed. By using a new context and cancelling it when the function is finished we should guarentee that the gRPC context is closed.

Fixes #624

I have not tested this locally as I don't have the time to setup a local results build, and I am not sure how to test it with unit tests.

linux-foundation-easycla[bot] commented 1 year ago

CLA Signed

The committers listed above are authorized under a signed CLA.

tekton-robot commented 1 year ago

Hi @stuartwdouglas. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
khrm commented 1 year ago

/ok-to-test

tekton-robot commented 1 year ago

The following is the coverage report on the affected files. Say /test pull-tekton-results-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/watcher/reconciler/dynamic/dynamic.go 66.4% 66.9% 0.5
khrm commented 1 year ago

/test pull-tekton-results-integration-tests

khrm commented 1 year ago

We probably need an e2e test to check this. Sure I would look into this. /assign @khrm

stuartwdouglas commented 12 months ago

Does this need anything else from my end?

enarha commented 12 months ago

@stuartwdouglas No. And thank you for the contribution! Let me try test that.

enarha commented 12 months ago

/assign @enarha

khrm commented 12 months ago

/release-note-none

tekton-robot commented 12 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sayan-biswas

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

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/tektoncd/results/blob/main/OWNERS)~~ [sayan-biswas] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
adambkaplan commented 12 months ago

/lgtm

It is pretty hard to add unit or e2e tests around this sort of thing - we're really only seeing this behavior with real operations at scale.

khrm commented 8 months ago

/kind bug