Commit 0e9c0ac
committed
Fix race condition in config-manager when label is unset
When the node label (nvidia.com/device-plugin.config) is not set, a race
condition could cause the config-manager to hang indefinitely on startup.
The issue occurred when the informer's AddFunc fired before the first Get()
call, setting current="" and broadcasting. When Get() was subsequently called,
it found lastRead == current (both empty strings) and waited forever, as no
future events would wake it up.
This fix adds an 'initialized' flag to SyncableConfig to ensure the first
Get() call never waits, regardless of timing. Subsequent Get() calls still
wait properly when the value hasn't changed.1 parent 624b771 commit 0e9c0ac
1 file changed
+7
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
109 | | - | |
| 110 | + | |
110 | 111 | | |
111 | 112 | | |
| 113 | + | |
112 | 114 | | |
113 | 115 | | |
114 | 116 | | |
| |||
0 commit comments