Description
In ES core, there is the GroupedActionListener
which is a delegating action listener.
GroupedActionListener#onResponse
is to be invoked multiple times (configurable) under any context.
The last invocation's context is the one that will be used to call on the delegate listener.
We should implement some guardrails to prevent that the delegate listener is invoked under different contexts depending on the order of the GroupedActionListener#onResponse
invocations.
The above is just a particular example. There are probably multiple ways where listeners are batched which are then executed under the same context, although they might have been batched under different contexts, eg ActionListener#onResponse(Iterable<ActionListener<Response>>, Response)
.