Skip to content

Reduce usage of TaskAwareRequest#setParentTask #89383

@DaveCTurner

Description

@DaveCTurner

Today we associate child tasks with their parents by explicitly calling TaskAwareRequest#setParentTask in almost 100 places. This is easy to forget or to get wrong (e.g. #88616) and yet we increasingly rely on these parent/child associations for things like support cases and our APM integration.

We should make it so that the path of least friction is one that automatically links tasks with their parents, so that opting-out of this behaviour needs additional effort. For instance, almost all calls to TransportService#sendRequest should be using sendChildRequest instead, and NodeClient should be able to set up parent task relationships too. Maybe this means we need a different Client for the REST layer, or maybe we could create tasks for REST requests too.

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