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.
DataParallelProfileHandler.ProcessResultsandPDProfileHandler.ProcessResultsrebuild theirtargets to override the port:
Metadata and metrics are cloned; attributes are passed as
nil, andNewEndpointturns nil intoan empty map.
ProcessResultsruns insideSchedule, before the director callsPreRequestplugins. So, underthese two handlers every
PreRequestplugin sees endpoints with no attributes, while undersingleit 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 ofnilcarries 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.