-
Notifications
You must be signed in to change notification settings - Fork 435
Closed
Description
The mount cache is read here without locking:
nvidia-container-toolkit/internal/discover/mounts.go
Lines 59 to 67 in 4604e3b
| func (d *mounts) Mounts() ([]Mount, error) { | |
| if d.lookup == nil { | |
| return nil, fmt.Errorf("no lookup defined") | |
| } | |
| if d.cache != nil { | |
| d.logger.Debugf("returning cached mounts") | |
| return d.cache, nil | |
| } |
But it is set here while locked:
| d.cache = mounts |
Best case here is you end up with 2 (or technically possibly more) things running the mounts code needlessly.
Worse cases could be undefined behavior due to the go memory model.
jgehrcke
Metadata
Metadata
Assignees
Labels
No labels