Matthew Heon
2c6dadd724
Fix a locking bug in that could cause a double-unlock
...
The `cleanupExecBundle` function was only meant to be called on a
locked container, as it does some state mutation operations. It
also has a timed wait (if the directory is busy and can't be
removed yet, give it a few milliseconds) in which it deliberately
yields the lock to not block the container for that time.
The `healthCheckExec()` function calls `cleanupExecBundle` out of
a `defer` block. This is after the `defer c.lock.Unlock()` so it
fires afterwards when the function returns, so we're normally
fine - the container is still locked when our defer runs. The
problem is that `healthCheckExec()` also unlocks the container
during the expensive exec operation, and can actually fail and
return while not holding the lock - meaning our `defer` can fire
on an unlocked container, leading to a potential double unlock
in `cleanupExecBundle`.
We could, potentially, re-lock the container after the exec
occurs, but we're actually waiting for a `select` to trigger to
end the function, so that's not a good solution. Instead, just
re-lock (if necessary) in the defer, before invoking
`cleanupExecBundle()`. The `defer c.lock.Unlock()` will fire
right after and unlock after us.
Fixes #26968
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2025-09-03 10:19:37 -04:00
..
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2024-01-04 11:53:38 +02:00
2025-09-01 12:33:04 +02:00
2024-09-03 15:14:15 +02:00
2025-09-01 12:33:04 +02:00
2024-11-27 08:09:50 -05:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2024-11-27 08:09:50 -05:00
2024-11-27 08:09:50 -05:00
2025-09-03 10:19:37 -04:00
2024-01-04 11:53:38 +02:00
2024-02-08 09:35:39 -05:00
2025-02-17 14:32:34 -05:00
2024-09-02 11:21:35 +01:00
2025-09-01 12:33:04 +02:00
2025-07-03 16:04:48 -04:00
2025-09-02 14:18:15 +00:00
2025-09-01 12:33:04 +02:00
2025-04-07 18:11:06 +02:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2024-01-04 11:53:38 +02:00
2024-02-08 09:35:39 -05:00
2024-02-08 09:35:39 -05:00
2024-11-01 18:53:08 +01:00
2024-01-04 11:53:38 +02:00
2024-11-27 08:09:50 -05:00
2024-11-27 08:09:50 -05:00
2024-01-04 11:53:38 +02:00
2024-02-08 09:35:39 -05:00
2024-02-08 09:35:39 -05:00
2024-06-27 10:50:17 +02:00
2025-09-01 12:33:04 +02:00
2024-01-04 11:53:38 +02:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2022-03-23 19:05:29 +01:00
2025-03-12 21:27:00 +01:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2024-06-04 18:03:46 +02:00
2024-06-04 18:03:46 +02:00
2025-05-12 17:01:35 +02:00
2024-02-08 09:35:39 -05:00
2025-09-01 12:33:04 +02:00
2024-02-08 09:35:39 -05:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2024-01-04 11:53:38 +02:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2024-01-04 11:53:38 +02:00
2024-01-04 11:53:38 +02:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2024-02-02 11:02:43 -05:00
2025-09-01 12:33:04 +02:00
2024-06-21 18:01:26 +02:00
2025-09-01 12:33:04 +02:00
2024-01-04 11:53:38 +02:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2024-01-04 11:53:38 +02:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2024-02-08 09:35:39 -05:00
2024-02-08 09:35:39 -05:00
2024-02-08 09:35:39 -05:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2024-01-04 11:53:38 +02:00
2024-01-04 11:53:38 +02:00
2025-09-01 12:33:04 +02:00
2024-01-04 11:53:38 +02:00
2024-01-04 11:53:38 +02:00
2025-09-02 14:18:15 +00:00
2024-04-05 10:07:42 -04:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2025-02-11 15:13:29 +00:00
2025-02-11 15:13:29 +00:00
2025-02-11 15:13:29 +00:00
2025-02-11 15:13:29 +00:00
2025-05-13 17:20:10 +02:00
2024-01-04 11:53:38 +02:00
2025-09-01 12:33:04 +02:00
2024-04-23 11:16:40 +02:00
2024-01-04 11:53:38 +02:00
2024-02-08 09:35:39 -05:00
2024-01-04 11:53:38 +02:00
2025-09-01 12:33:04 +02:00
2024-08-15 11:07:27 +02:00
2024-07-09 11:15:29 +02:00
2025-09-01 12:33:04 +02:00
2024-02-08 09:35:39 -05:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2024-02-08 09:35:39 -05:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2025-09-01 12:33:04 +02:00
2025-04-02 13:35:14 -07:00
2025-03-24 17:44:43 +01:00
2025-09-01 12:33:04 +02:00
2025-05-20 15:52:27 +02:00
2025-09-01 12:33:04 +02:00
2024-02-08 09:35:39 -05:00
2024-02-08 09:35:39 -05:00
2024-01-04 11:53:38 +02:00
2024-01-04 11:53:38 +02:00
2024-05-22 17:47:01 -04:00
2025-09-01 12:33:04 +02:00