Repository navigation
Conversation
…rage The metadata storage started the calls of each operation from context.Background(). The HTTP calls of Upload and Download used no context. So the cancel and the deadline of the caller did not reach any call. Changes: - getAuthContext derives the new context from the context of the caller. It starts with empty outgoing metadata, so the token of the caller does not reach the storage. It stores the machine token as the token of the context. - The span of getAuthContext covers only the Authenticate call. The Authenticate call keeps its own timeout. - Upload and Download use http.NewRequestWithContext. - Add tests for cancel and deadline in the gRPC calls, the HTTP calls and the Authenticate call, and for the token of the caller. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
2403905
force-pushed
the
fix/OCISDEV-1761-metadata-caller-context
branch
from
November 30, 2026 18:14
27530d2 to
4cc5a7f
Compare
…etadata storage - Set an empty autoprop meta in the context from getAuthContext. The autoprop values of the caller no longer reach the storage. - Log a cancel of the caller at debug level, not at warning level. - Return an error when the outgoing context has no access token. Upload and Download no longer panic. - Add tests for autoprop isolation, failed authentication and the missing token. - Make the test helpers stop on test end and widen the time limits. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…leaves - Drop the cancel of the caller in Upload. A write does not stop halfway. - Bound Upload with a timeout of its own (60 seconds). - Add tests for the cancel and for the timeout. - Update the changelog entry. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2403905
force-pushed
the
fix/OCISDEV-1761-metadata-caller-context
branch
from
November 30, 2026 22:20
b4d9df9 to
5298d36
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The CS3 metadata storage ignores the cancel and the deadline of the caller.
PR still follows the 759 design. The Authenticate call keeps its own timeout, and the returned context has no added deadline. The only change is that the caller's cancel and deadline now flow through.
#759
Problem
getAuthContextinpkg/storage/utils/metadata/cs3.gostarted fromcontext.Background(). The cancel and the deadline of the caller did not reach the gRPC calls.UploadandDownloadusedhttp.NewRequestwithout a context. The HTTP calls had no limit.A caller that cancels its request did not stop the metadata calls. A caller with a deadline did not get an answer on time when a service was slow.
What changes
getAuthContextderives the new context from the context of the caller. It keeps the cancel, the deadline, the span and the values.getAuthContextspan covers only theAuthenticatecall. The returned context does not hold it, so the next calls are children of the span of the caller.Authenticatecall keeps its own timeout. The timeout does not live on the returned context.UploadandDownloadusehttp.NewRequestWithContext.Tests
pkg/storage/utils/metadata/cs3_caller_context_internal_test.go: cancel and deadline in the gRPC call, the HTTP GET and theAuthenticatecall, and the token of the caller.go test -race ./pkg/storage/utils/metadata/...andgo test ./pkg/share/manager/jsoncs3/...pass.Notes for the review
getAuthContext. The second one that merges needs a rebase.