Skip to content

NodeClient#executeLocally always executes action on the calling thread #92730

@DaveCTurner

Description

@DaveCTurner

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions