This is the corner stone of why I originally made QueryMetrics single-threaded. I agree that the ability to add dimensions and metrics from parallel threads is convenient, but allowing to `emit()` from concurrent threads is paving the road to hell of literally undiscoverable and undebuggable bugs with metrics.
All exceptions related to QueryMetrics that have been floating up since the introduction of this class represent our own misunderstanding of the execution flow of some queries - how and when data is transferred between threads, in what specific thread pool some code is actually executed, etc. QueryMetrics force maintainers to refine the threading and make data transitions more explicit, that is a good thing. Making QueryMetrics permissive is easier but it's like burying head in the sand. Where do you need parallel `emit()` and parallel `report()` is not enough? [ Full content available at: https://github.com/apache/incubator-druid/pull/6402 ] This message was relayed via gitbox.apache.org for [email protected]
