Skip to content

Profile handlers rebuild target endpoints with an empty attribute map before PreRequest #2411

Description

@Mohammad-nassar10

DataParallelProfileHandler.ProcessResults and PDProfileHandler.ProcessResults rebuild their
targets to override the port:

targetEndpoint := scheduling.NewEndpoint(newMetadata, target.GetMetrics().Clone(), nil)

Metadata and metrics are cloned; attributes are passed as nil, and NewEndpoint turns nil into
an empty map. ProcessResults runs inside Schedule, before the director calls PreRequest plugins. So, under
these two handlers every PreRequest plugin sees endpoints with no attributes, while under single it sees them populated. The map is empty rather than absent, so there is no error and no way to tell the two cases apart at runtime.

Is that intended? If so, it's worth documenting that PreRequest can't rely on endpoint attributes.
If not, passing target.Clone() instead of nil carries them through.

Hit in #2371, worked around there by moving the value into PluginState.
Ready to open a PR for either the fix or the doc change, whichever you prefer.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageIndicates an issue or PR lacks a triage label and requires one.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions