GitHub user zentol opened a pull request: https://github.com/apache/flink/pull/3128
[FLINK-5464] Improve MetricDumpSerialization error handling Rework of #3103. The key change introduced in the previous PR remains; if a gauge returns null it is not serialized. However, I've extended the PR to harden the entire serialization process against exceptions. The major gain here is that a single failed serialization does no longer destroys the entire dump; instead it is simply omitted. In order to allow that I had to replace the ```OutputStream```s with a ```ByteBuffer```. The former doesn't really allow you to handle failures in between serialization steps, as you can't reset the stream in any way. The ```ByteBuffer``` is manually resized if a ```BufferOverflowException``` occurs. * ```MetricDump(De)Serializer#(de)serialize``` will no longer throw any exception but catch and log them instead * Exceptions during the serialization of a metric will cause that metric to be skipped. * added test for handling of gauge returning null * added test for manual resizing of backing array You can merge this pull request into a Git repository by running: $ git pull https://github.com/zentol/flink 5464_mqs_npe Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/3128.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3128 ---- commit 8610a47c407afe2140cd4b5651ebc794ef3feec8 Author: zentol <ches...@apache.org> Date: 2017-01-12T11:41:56Z [FLINK-5464] [metrics] Ignore metrics that are null commit 442c0a4dee002b73e5b86d6c7bb274484a8900ac Author: zentol <ches...@apache.org> Date: 2017-01-16T10:25:58Z [hotfix] Remove unused variable in MetricDumpSerializerTest commit 0f813ebf53414b1b68c6dfe8e3e1dbc896054c36 Author: zentol <ches...@apache.org> Date: 2017-01-12T11:42:26Z [FLINK-5464] [metrics] Improve MetricDumpSerialization exception handling ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---