Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Commit 97e83c2

Browse files
committed
Tweak comments
1 parent d0b6174 commit 97e83c2

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

internal/controller/appwrapper_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ type PodCounts struct {
6868
// Reconcile one AppWrapper or dispatch next AppWrapper
6969
// Normal reconciliations "namespace/name" implement all phase transitions except for Queued->Dispatching
7070
// Queued->Dispatching transitions happen as part of a special "*/*" reconciliation
71-
// In a "*/*" invocation, we first decide which AppWrapper to dispatch then make the transition
71+
// In a "*/*" reconciliation, we first decide the AppWrapper to dispatch (dispatchNext)
72+
// We then dispatch this AppWrapper (Queued->Dispatching transition)
7273
func (r *AppWrapperReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
7374
log := log.FromContext(ctx)
7475

internal/controller/timings.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,22 @@ import (
2323
// This file defines all the time constants used in mcad
2424

2525
const (
26+
// Timeouts
27+
requeuingTimeout = 2 * time.Minute // minimum wait before aborting Requeuing
28+
dispatchingTimeout = 2 * time.Minute // minimum wait before aborting Dispatching
29+
runningTimeout = 5 * time.Minute // minimum wait before aborting Running
30+
cacheConflictTimeout = 5 * time.Minute // minimum wait before invalidating the cache
31+
clusterCapacityTimeout = time.Minute // how long to cache cluster capacity
32+
2633
// Cluster capacity is only refreshed when trying to dispatch AppWrappers and only after
27-
// the previous measurement has timed out, so it is necessary to trigger dispatch on
34+
// the previous measurement has timed out, so it is necessary to call dispatchNext on
2835
// a regular basis (we do) to ensure we detect new capacity (such as new schedulable nodes)
29-
clusterCapacityTimeout = time.Minute // how long to cache cluster capacity
30-
31-
cacheConflictTimeout = 5 * time.Minute // when to give up on a cache conflict
32-
33-
// Timeouts
34-
requeuingTimeout = 2 * time.Minute // minimum wait before aborting Requeuing
35-
dispatchingTimeout = 2 * time.Minute // minimum wait before aborting Dispatching
36-
runningTimeout = 5 * time.Minute // minimum wait before aborting Running
3736

3837
// RequeueAfter delays
39-
// This is the maximum delay before the next reconciliation event but reconciliation
40-
// may be triggered earlier due for instance to pod phase changes. Moreover, the reconciliation
41-
// itself may be delayed due to the on-going reconciliation of other events.
42-
runDelay = time.Minute // maximum delay before next reconciliation when running pods
43-
dispatchDelay = time.Minute // maximum delay before next dispatch attempt with queued AppWrappers
38+
runDelay = time.Minute // maximum delay before next reconciliation of a Running AppWrapper
39+
dispatchDelay = time.Minute // maximum delay before next "*/*" reconciliation (dispatchNext)
40+
41+
// The RequeueAfter delay is the maximum delay before the next reconciliation event.
42+
// Reconciliation may be triggered earlier due for instance to pod phase changes.
43+
// Reconciliation may be delayed due to the on-going reconciliation of other events.
4444
)

0 commit comments

Comments
 (0)