Adapted StructuredTaskScope for Context and cancellation
Alan Bateman
alan.bateman at oracle.com
Sat Oct 25 08:20:20 UTC 2025
On 24/10/2025 18:40, Wesley Hill wrote:
>
> Thanks for writing up your experiences. What pain points would have
> remain if somehow OpenTelemetry could use ScopedValues?
>
>
> Ignoring that OTel Context propagation pain point, there was the one
> other pain point related to Configuration:
>
> * There's no accessor with which to get the timeout configured on a
> JDK's Configuration object, and
> * Configuration.withTimeout does not allow passing null to clear an
> already-set timeout.
>
> So we would still need our own copy of the Configuration class to
> manage the fact that we want to know the timeout to set the Deadline
> on our Context, and we don't want to pass the timeout down to
> StructuredTaskScope since we're managing cancellation our way.
>
Could you expand a bit on how this arises? There is no timeout by
default so something (the composite object?) must be calling withTimeout
to set a timeout, then something else is looking to remove it (or set it
to Duration.ofDays(Long.MAX_VALUE), which is effectively the same
thing). If I read your first mail correctly then the telemetry Context
is self destructing object and the Configuration is being used to carry
the Context deadline through to the Context, is that right?
-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20251025/b68d3f14/attachment.htm>
More information about the loom-dev
mailing list