linkerd2
linkerd2 copied to clipboard
Add `Link` informer to `service-mirror`
When looking through https://github.com/linkerd/linkerd2/issues/11494 I noticed some of the error handling in the service-mirror's main routine could be improved. For example:
-
When we load cluster credentials, we only log the error but continue operating with incorrect data
- In versions <
stable-2.14
, this can cause panics due to non re-entrant logic. We will enterrestartClusterWatcher
, stop the watcher, then re-enter and attempt to stop the watcher (closing a closed channel panics).
- In versions <
- By default, we don't handle watch events that are errors, i.e.
watch.Error
.- Instead, we log a generic "type is not expected" message which does not indicate where the issue occurred, what type was expected, and what was received. In general these errors are going to be benign (i.e. 410 status codes expected in the watcher) but to our users they will appear to be concerning.
We are also maintaining our own reflector logic here instead of relying on the shared index abstractions provided by client-go. I'm not sure if there was ever a reason to it, we have a generated client for Link
resources. I think using a shared informer here is going to be more efficient and allow us to handle some of these cases a bit better.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.