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

Client error propagation #86

Merged

Conversation

carlbraganza
Copy link
Contributor

@carlbraganza carlbraganza commented Dec 11, 2024

Ensure that client errors (context cancellation or failure to read responses) will result in the CSI driver stream being canceled.

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change
/kind bug
/kind cleanup
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake

What this PR does / why we need it:
This ensures that when a client aborts its receive stream, or stops reading responses, or the network connection between the client and the sidecar fails, the CSI driver stream will get canceled.

Which issue(s) this PR fixes:

Fixes #66

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Dec 11, 2024
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 11, 2024
@carlbraganza carlbraganza force-pushed the client-error-to-driver branch from 0f12ac8 to d24c9fc Compare December 11, 2024 02:18
@carlbraganza
Copy link
Contributor Author

/assign @PrasadG193

@carlbraganza carlbraganza force-pushed the client-error-to-driver branch 2 times, most recently from 1954211 to fa2884c Compare December 13, 2024 00:40
@carlbraganza carlbraganza force-pushed the client-error-to-driver branch 4 times, most recently from 1d0baba to b605c85 Compare December 13, 2024 23:07
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 13, 2024
@carlbraganza carlbraganza force-pushed the client-error-to-driver branch 4 times, most recently from 051fe84 to 4e99c01 Compare December 14, 2024 06:42
// Create a timeout context so that failure in either sending to the client or
// receiving from the CSI driver will ultimately abort the handler session.
// The context could also get canceled by the client.
ctx, cancelFn := context.WithTimeout(s.getMetadataAllocatedContextWithLogger(req, stream), s.config.MaxStreamDur)
Copy link
Contributor

Choose a reason for hiding this comment

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

just to confirm, this timeout will be applicable for take taken for complete data transfer not just a page (maxResults), right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that is correct - it will span multiple pages.

@carlbraganza carlbraganza force-pushed the client-error-to-driver branch from 4e99c01 to b28723c Compare December 18, 2024 18:39
@carlbraganza carlbraganza force-pushed the client-error-to-driver branch from b28723c to 29b0c54 Compare December 18, 2024 18:41
Copy link
Contributor

@PrasadG193 PrasadG193 left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 19, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: carlbraganza, PrasadG193

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 [PrasadG193,carlbraganza]

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

@k8s-ci-robot k8s-ci-robot merged commit c81d89e into kubernetes-csi:main Dec 19, 2024
8 checks passed
@carlbraganza carlbraganza deleted the client-error-to-driver branch January 9, 2025 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Premature stream termination is not propagated
4 participants