Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pilot needs better validation of XDS responses #14744

Closed
howardjohn opened this issue Jun 12, 2019 · 2 comments
Closed

Pilot needs better validation of XDS responses #14744

howardjohn opened this issue Jun 12, 2019 · 2 comments

Comments

@howardjohn
Copy link
Member

Context: #14414

Pilot does some validation of XDS responses:

if err = l.Validate(); err != nil {
retErr := fmt.Errorf("LDS: Generated invalid listener for node %v: %v", con.modelNode, err)
adsLog.Errorf("LDS: Generated invalid listener for node:%s: %v, %v", con.modelNode.ID, err, l)
pushes.With(prometheus.Labels{"type": "lds_builderr"}).Add(1)
// Generating invalid listeners is a bug.
// Panic instead of trying to recover from that, since we can't
// assume anything about the state.
panic(retErr.Error())
}

There are two problems:

  • Most of the config is already serialized to struct/any. This will NOT be validated. (Actually, maybe if we do it to any it does, but I doubt it. Struct doesn't for sure). So we have a false sense of confidence that the responses are valid
  • When we do detect something is invalid, we shouldn't panic. Instead we should drop the single item that failed in the response. Another option is dropping the whole response. This depends if we would rather be atomic in our failures or just minimize the impact of the failures
@howardjohn
Copy link
Member Author

More info, ref https://github.com/istio/istio/pull/14854/files. We do Validate() in duplicated locations sometimes

@howardjohn
Copy link
Member Author

We no longer panic

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

No branches or pull requests

1 participant