Open guyboertje opened 6 years ago
This is a great idea from a UX perspective.
Fun fact for anyone (attempting) to implement this, changing a thread name in java is not threadsafe! There's a long exchange on the concurrency interest mailing list about this.
IIRC, the general recommendation is to set the thread name once, not frequently.
Maybe there's some other way to get the same sort of introspection via the HTTP UI with our own datastructure? I suspect, unfortunately, that anything synchronized will bear a performance cost. However, a volatile String
may not be so bad.
@original-brownbear what are your thoughts WRT perf impact here with the Java exec?
Oh, here's the link to the mailing list thread: http://cs.oswego.edu/pipermail/concurrency-interest/2013-March/010935.html
@andrewvc I don't think changing the thread name will be a performance issue (you'd only synchronise in the setup phase of the pipeline anyways wouldn't you?). The input threads aren't logically related to the Java exec in any way though, so Java exec isn't what you should worry about here in the first place.
When using multiple inputs of the same type it will be easier to identify the input thread in a hot threads or JVM thread dump if we can put an
id
in the thread name.This also might enable some interesting UI info from monitoring.