Skip to content

Commit 781b509

Browse files
committed
explain lack of finalizer ordering in godoc
1 parent c2c8215 commit 781b509

File tree

1 file changed

+9
-0
lines changed
  • staging/src/k8s.io/apimachinery/pkg/apis/meta/v1

1 file changed

+9
-0
lines changed

staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/types.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,15 @@ type ObjectMeta struct {
250250
// is an identifier for the responsible component that will remove the entry
251251
// from the list. If the deletionTimestamp of the object is non-nil, entries
252252
// in this list can only be removed.
253+
// Finalizers may be processed and removed in any order. Order is NOT enforced
254+
// because it introduces significant risk of stuck finalizers.
255+
// finalizers is a shared field, any actor with permission can reorder it.
256+
// If the finalizer list is processed in order, then this can lead to a situation
257+
// in which the component responsible for the first finalizer in the list is
258+
// waiting for a signal (field value, external system, or other) produced by a
259+
// component responsible for a finalizer later in the list, resulting in a deadlock.
260+
// Without enforced ordering finalizers are free to order amongst themselves and
261+
// are not vulnerable to ordering changes in the list.
253262
// +optional
254263
// +patchStrategy=merge
255264
Finalizers []string `json:"finalizers,omitempty" patchStrategy:"merge" protobuf:"bytes,14,rep,name=finalizers"`

0 commit comments

Comments
 (0)