[BUG] Synchronous calls with async transport should preserve caller stack trace
What is the bug?
When an OpenSearchClient built with async transport fails, the transports unwrap causes and propagate them if they're RuntimeExceptions. We lose the stack trace since the exception originated in some pooled thread. Can these exceptions instead be re-wrapped in an IOException and propagated as the interface allows?
As it stands I just wrap the existing transport with one that catches and wraps this way, so it's not the end of the world, but it was confusing that we got random stack traces from a "synchronous" call.
That's a good find! Care to fix/contribute, even starting with a test that demonstrates the issue?
Sure - here's a first go: https://github.com/opensearch-project/opensearch-java/pull/656