flyingImer commented on issue #3444:
URL: https://github.com/apache/polaris/issues/3444#issuecomment-4129750001
Rather than adding request ID propagation as another one-off pattern in
`TaskExecutorImpl` (alongside the existing ad-hoc realm and principal
propagation), I am thinking of the problem into a pluggable
`AsyncContextPropagator` SPI:
```java
public interface AsyncContextPropagator {
Object capture(); // snapshot on request thread
AutoCloseable restore(Object); // re-establish on task thread + cleanup
}
```
Each propagator is responsible only for its own lifecycle — capture its own
piece of context, restore it, and clean up after itself. The propagator does
not need to know about other propagators, about TaskExecutorImpl's retry logic,
or about CDI scope activation. TaskExecutorImpl handles orchestration
(discovery via CDI Instance, LIFO cleanup ordering, error isolation); each
propagator handles its own domain.
See my pr here: https://github.com/apache/polaris/pull/4061
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]