zentol commented on a change in pull request #6850: [FLINK-10252] Handle
oversized metric messges
URL: https://github.com/apache/flink/pull/6850#discussion_r230328817
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/metrics/dump/MetricQueryService.java
##########
@@ -136,20 +134,53 @@ public void unregister(Metric metric) {
}
private void
unregisterOversizedMetrics(MetricDumpSerialization.MetricSerializationResult
serializationResult) {
- for (Metric metric : serializationResult.counters.keySet()) {
- unregister(metric);
+ if (serializationResult.serializedCounters.length >
maximumFramesize) {
+ LOG.warn("The serialized counter metric is larger than
the maximum frame size, " +
+ " so maybe not all metrics would be reported.");
+ serializationResult.serializedCounters = new byte[0];
Review comment:
instead of mutating the result you can create a new one since the
constructor is public.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services