cli-utils icon indicating copy to clipboard operation
cli-utils copied to clipboard

safely consuming kstatus collector updates

Open ecordell opened this issue 2 years ago • 8 comments

The collector protects ResourceStatuses with a mutex for updates, but then passes the whole object to a notify callback:

https://github.com/kubernetes-sigs/cli-utils/blob/8609e42fe8677bfc3a8ae13583b4b31540f1f0a3/pkg/kstatus/polling/collector/collector.go#L91-L93

Since the callback runs in a goroutine without any synchronization, the read is racy (and potentially very out of date).

The simplest way to fix it would be to lock around the notify call, but of course then observers can potentially block the poller. I thought I'd open an issue since there should probably be some discussion around the intended use.

ecordell avatar Jul 22 '23 14:07 ecordell

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Jan 26 '24 04:01 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Feb 25 '24 05:02 k8s-triage-robot

/remove-lifecycle rotten

ecordell avatar Feb 28 '24 19:02 ecordell

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar May 28 '24 20:05 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Jun 27 '24 20:06 k8s-triage-robot

pkg/kstatus/polling should probably be deprecated. pkg/kstatus/watcher is the preferred way to get status updates now.

If you want to make a PR to fix it, I'll review it, but we're not really investing in the polling any more.

karlkfi avatar Jul 02 '24 18:07 karlkfi