You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "yandrey321 (via GitHub)" <gi...@apache.org> on 2026/10/13 18:52:11 UTC
[PR] HDDS-16742. Read cmdType from the request descriptor instead of rendering it to text [ozone]
yandrey321 opened a new pull request, #11517:
URL: https://github.com/apache/ozone/pull/11517
## What changes were proposed in this pull request?
`GrpcMetricsServerRequestInterceptor.onMessage` set the `LatestRequestType` tag by rendering the whole request with
`message.toString()` and parsing the first line. That costs a full text rendering of every `OMRequest`, and the
parsing breaks on messages that do not start with `cmdType: ...`.
Key implementation details:
- `cmdType` is read with `getDescriptorForType().findFieldByName("cmdType")`, inside the existing
`instanceof AbstractMessage` branch. The interceptor stays generic, with no `framework` → `interface-client`
dependency. Messages without the field leave the tag unchanged.
- The tag value is unchanged: for an enum field, `getField(...).toString()` returns the value name (`CreateKey`).
- `GrpcMetrics.requestType` is now `volatile`: it is written without a lock and read in the synchronized
`getMetrics()`.
Generated-by: Claude Code (Claude Opus 4.8)
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-16742
## How was this patch tested?
New `TestGrpcMetricsServerRequestInterceptor`, using `SCMBlockLocationRequest` (same shape as `OMRequest`: `cmdType`
as field 1, free-text `traceID` as field 2) with mocked gRPC calls.
Test findings against the previous interceptor:
- A protobuf message without `cmdType` set the tag to a fragment of a field value (`"user`). Now unchanged.
- A non-protobuf message threw `ArrayIndexOutOfBoundsException` inside the interceptor. Now counted as unknown.
- A request with `:` and newlines in `traceID` reports `GetScmInfo` both before and after, confirming the tag value
is unchanged.
`hdds-server-framework` unit tests: 654 run, 0 failures.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-16742. Read cmdType from the request descriptor instead of rendering it to text [ozone]
Posted by "yandrey321 (via GitHub)" <gi...@apache.org>.
yandrey321 commented on PR #11517:
URL: https://github.com/apache/ozone/pull/11517#issuecomment-6154307276
@jojochuang could you please take a look? Its one more performance improvement in metrics.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-16742. Read cmdType from the request descriptor instead of rendering it to text [ozone]
Posted by "jojochuang (via GitHub)" <gi...@apache.org>.
jojochuang merged PR #11517:
URL: https://github.com/apache/ozone/pull/11517
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-16742. Read cmdType from the request descriptor instead of rendering it to text [ozone]
Posted by "jojochuang (via GitHub)" <gi...@apache.org>.
jojochuang commented on PR #11517:
URL: https://github.com/apache/ozone/pull/11517#issuecomment-6178548179
This is great finding. I guess OM to SCM doesn't happen that often, so we never noticed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org