Not sure if this is a bug or not but I found it surprising and think it's worthy of discussion. REST actions all run on a transport thread and typically call some method on a Client which ends up calling NodeClient#executeLocally and ultimately running a transport action on the local node. However AFAICT there's nowhere in this call stack which forks onto a different thread, even if the transport action would fork off onto a different thread when handling a transport request received from elsewhere.
I mean this kinda makes sense, it's the TransportService that tracks which handlers fork where, and calls into the NodeClient bypass the TransportService, but still it seems like a potential source of inappropriate work on transport threads.
Is that a known thing? Am I wrong to be surprised about this? (or indeed am I wrong about this behaviour?) Not much time to investigate further now so I'm opening this to make sure we discuss it.
Not sure if this is a bug or not but I found it surprising and think it's worthy of discussion. REST actions all run on a transport thread and typically call some method on a
Clientwhich ends up callingNodeClient#executeLocallyand ultimately running a transport action on the local node. However AFAICT there's nowhere in this call stack which forks onto a different thread, even if the transport action would fork off onto a different thread when handling a transport request received from elsewhere.I mean this kinda makes sense, it's the
TransportServicethat tracks which handlers fork where, and calls into theNodeClientbypass theTransportService, but still it seems like a potential source of inappropriate work on transport threads.Is that a known thing? Am I wrong to be surprised about this? (or indeed am I wrong about this behaviour?) Not much time to investigate further now so I'm opening this to make sure we discuss it.