Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
xds: refactor xdsServer wrapper, modify filter chain matching handler…
… for server routing config (#8333) This is split from #8318, refactoring changes include: 1. FilterChainMatchingHandler 1.1. Previously filter chain match is built-in in XdsServerCredential for xdsServer. (But it does not have to be XdsServerCredential.) The protocol negotiator associated with the XdsServerCredential does the filter chain match computation. Now filter chain match is through a FilterChainMatchingHandler and it always run. As a result, it sets attributes of sslContextProviderSupplier from xds config in protocol negotiation event. 1.2. The previous protocol negotiator associated with the XdsServerCredential is modified to just lookup the config in the attribute set above and decide to use xds config credential or fallback credential. 1.3. Previously credential is a must in XdsBuilder. Now credential becomes optional to allow routing config to be fetched. Xds TCP listener update will always be used to run filter chain match. Later, we will add routing config in filter chain match and apply http filter configs by installing ConfigApplyingInterceptor. 2. Removed xdsClientWrapperForServerXds, unnecessarily complicated. 3. Changed event attribute key. Previously filter chain matching happens in the xdsClientWrapperForServerXds, the xds client wrapper is passed to negotiation handler via attributes to allow protocol negotiator to trigger the filter chain matching computation. Now the attributes becomes an atomic config selector reference that xdsServerWrapper will inject by watching xds resources updates via xds client. 4. Previously there are multiple server states enum in xdsServerWrapper, this is removed because it is unnecessarily complicated. But there are still isServing status to avoid re-start delegate upon listener update. 5. Previously xdsServerWrapper ignores any xds updates once initial started, now we allow dynamic update to happen even if server is up. This is done via updating config selector atomic reference upon listener update. 6. Previously xdsServerWrapper synchronizes on the server object, this is modified to syncContext to be more manageable.
- Loading branch information