Conversation
Assisted-by: OpenAI Codex Signed-off-by: Amrinder Randhawa <272048731+amarrtech@users.noreply.github.com>
10 of 13 tasks
|
Assisted-by: OpenAI Codex Signed-off-by: Amrinder Randhawa <272048731+amarrtech@users.noreply.github.com>
This branch has not been deployed
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.
What does the PR do?
Preserves the exact byte length of gRPC metadata when
GrpcServerCarrierreturns a value to the OpenTelemetry propagator.grpc::string_refvalues are not null-terminated. Constructing the returnednostd::string_viewfromdata()alone invokes the pointer constructor, which scans past the metadata boundary. For a 55-byte W3Ctraceparent, trailing bytes can make the value appear longer and causeHttpTraceContextto reject an otherwise valid parent context.This change constructs the view from both
data()andsize(), so extraction sees exactly the bytes supplied by gRPC. It also adds a focused unit test for the exact-length boundary.Checklist
<commit_type>: <Title>pre-commit install, pre-commit run --all); see Caveats.Commit Type:
Related PRs:
None.
Where should the reviewer start?
src/grpc/infer_handler.h, inGrpcServerCarrier::GetandGrpcMetadataValueView.src/test/grpc_carrier_test.cc, for the non-null trailing-byte regression.Test plan:
GrpcServerCarrierTest.PreservesMetadataValueLength, built when gRPC and tracing are enabled. It backs a 55-bytegrpc::string_refwith a non-null sentinel byte followed by a terminator and asserts the OpenTelemetry view remains exactly 55 bytes.uvx --from pre-commit pre-commit run --files src/grpc/infer_handler.h src/test/CMakeLists.txt src/test/grpc_carrier_test.cc— passed every applicable hook, including clang-format, codespell, secret scan, whitespace, and copyright.git diff --check— passed.OpenTelemetryTest.test_grpc_trace_simple_model_context_propagationinqa/L0_trace/opentelemetry_unittest.pyverifies that gRPC trace metadata is extracted as the expected parent context.Caveats:
This host does not have CMake, a packaged Linux Triton server, or the GPU test stack needed to build the new C++ target and run
qa/L0_trace; CI/reviewer infrastructure must run those. A repository-wide pre-commit run was attempted, but untouchedmaincurrently reports existing repo-wide flake8 violations and the copyright hook proposes broad unrelated header updates. All changed files pass the complete configured hook set in isolation.The NVIDIA CLA still needs to be confirmed by the contributor. The
fixlabel exists, but GitHub does not grant external contributors permission to apply it; no label was added.Squash message:
fix: preserve gRPC trace metadata lengthBackground
Operators reported valid gRPC
traceparentmetadata being dropped nondeterministically because bytes beyond thegrpc::string_refvalue affected its apparent length. This makes inference spans disappear or detach from the caller trace.Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
traceparentmetadata past its end, so OpenTelemetry drops some valid trace contexts #8984