Skip to content

xds: HTTP filters on the client ignore the done callback #8925

@easwars

Description

@easwars

The xDS resolver currently implements an interceptorList struct that chains all the HTTP filters on the client and runs them one after the other. See:

type interceptorList struct {

When a new config selector is created by the xDS resolver, it creates an interceptorList for every weighted cluster within every route. See:

interceptor, err := newInterceptor(r.xdsConfig.Listener.APIListener.HTTPFilters, wc.HTTPFilterConfigOverride, rt.HTTPFilterConfigOverride, r.xdsConfig.VirtualHost.HTTPFilterConfigOverride)

When the config selector is asked to return matching configuration for an RPC, it returns this interceptorList as part of the RPCConfig. See:

Interceptor: cluster.interceptor,

When an RPC is initiated and a new stream is being created for it, the config selector is invoked and the interceptors are run here:

cs, err := rpcConfig.Interceptor.NewStream(ctx, rpcInfo, done, ns)

But the NewStream method on the interceptorList ignores the done callback passed to it, and instead passes an empty function to the chain of interceptors. See:

return newStream(ctx, func() {})

Also, newClientStream passes an empty function as the done callback as well here:

return newStream(ctx, func() {})

@dfawley

  • Should the interceptorList ignore the done callback?
  • Should newClientStream pass an empty function as the done callback?
  • With the filter state retention changes that we are making as part of A83, when a Filter instance shares some state to all of its interceptors, it would have to know exactly when the interceptors are done. Filters that share state could still wrap the the done callback passed to them in NewStream and do whatever they have to do when the interceptor is done.

Metadata

Metadata

Assignees

Labels

Area: xDSIncludes everything xDS related, including LB policies used with xDS.P2Type: Question

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions