-
If I'm using a thread pool, how should I best make sure that the For context I'm integrating OpenTelemetry with the Open Liberty application server, the user could deploy several applications to the server, all of which would use the same thread pool and each request would be served with a new task submitted to the thread pool. If the user fails to close a Options I'm currently considering
Does anyone have any better suggestions or see any problems with either of these approaches? Other notesBefore #5061 was merged in v1.22, if you forgot to close a scope but the parent scope was correctly closed, the current scope would be set back to what it was before the parent was created and the child wouldn't leak. (The downside of the previous behaviour was that you end up in all sorts of trouble if you close scopes in the wrong order or on the wrong thread.) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I think the best option is to force |
Beta Was this translation helpful? Give feedback.
I think the best option is to force
Context.root().makeCurrent()
before handing out the thread to the user. Yes, there will be a warning when scopes areproperlyimproperly closed, but this is exactly what you need to know. Not closing scopes can lead to very bad bugs, so knowing about it is quite important.