Matthew Heon
f93cad508a
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-04 13:54:49 -04:00
..
2025-06-12 08:02:31 +00:00
2024-02-08 09:35:39 -05:00
2025-08-19 18:14:33 +00:00
2017-11-01 11:24:59 -04:00
2024-01-04 11:53:38 +02:00
2025-03-31 12:27:55 -07:00
2024-09-03 15:14:15 +02:00
2024-04-19 09:52:14 +02:00
2024-11-27 08:09:50 -05:00
2024-07-11 09:39:56 -04:00
2025-08-11 19:44:59 +00:00
2024-02-08 09:35:39 -05:00
2025-03-21 13:15:44 +01:00
2024-11-28 14:01:45 +03:00
2025-07-03 16:04:48 -04:00
2025-03-31 12:27:55 -07:00
2024-11-27 08:09:50 -05:00
2024-11-27 08:09:50 -05:00
2025-09-04 13:54:49 -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-04-30 16:21:38 +02:00
2025-07-03 16:04:48 -04:00
2025-09-02 14:04:00 -04:00
2025-04-02 13:35:14 -07:00
2025-04-07 18:11:06 +02:00
2025-04-15 13:24:03 +02:00
2025-01-15 07:08:27 -05:00
2025-07-15 17:15:19 +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
2024-08-19 11:41:28 +02:00
2024-01-04 11:53:38 +02:00
2025-04-17 08:36:27 +02:00
2025-09-02 14:01:13 -04:00
2024-02-08 09:35:39 -05:00
2022-03-23 19:05:29 +01:00
2025-03-12 21:27:00 +01:00
2024-11-19 19:44:14 +01:00
2025-03-04 16:48:50 +01: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
2024-04-10 11:55:35 +02:00
2024-02-08 09:35:39 -05:00
2025-04-02 13:35:14 -07:00
2025-04-17 08:36:27 +02:00
2024-01-04 11:53:38 +02:00
2025-04-04 14:42:20 +02:00
2025-04-02 13:35:14 -07:00
2024-09-03 15:14:15 +02:00
2024-09-20 15:19:22 +02:00
2024-01-04 11:53:38 +02:00
2024-10-30 13:35:56 +01:00
2024-02-08 09:35:39 -05:00
2024-07-12 15:11:34 +02:00
2024-01-04 11:53:38 +02:00
2024-01-04 11:53:38 +02:00
2025-07-03 16:04:48 -04:00
2025-05-12 17:01:42 +02:00
2024-02-02 11:02:43 -05:00
2024-02-02 11:02:43 -05:00
2024-06-21 18:01:26 +02:00
2025-04-02 13:35:14 -07:00
2024-01-04 11:53:38 +02:00
2025-02-11 14:51:34 -05:00
2025-04-02 13:35:14 -07:00
2025-02-11 14:51:34 -05:00
2025-06-26 19:37:16 +02:00
2025-02-06 18:28:12 -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-02-08 09:35:39 -05:00
2024-02-08 09:35:39 -05:00
2024-02-08 09:35:39 -05:00
2024-07-22 10:30:42 +02:00
2025-04-27 20:51:11 +10:00
2024-01-04 11:53:38 +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
2024-01-04 11:53:38 +02:00
2025-09-02 14:03:54 -04:00
2024-04-05 10:07:42 -04:00
2025-06-26 19:37:16 +02:00
2024-04-05 10:07:42 -04: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
2024-02-08 09:35:39 -05: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-03-31 12:27:55 -07:00
2024-08-15 11:07:27 +02:00
2024-07-09 11:15:29 +02:00
2025-06-26 19:37:16 +02:00
2024-02-08 09:35:39 -05:00
2024-02-08 09:35:39 -05:00
2025-05-28 13:10:10 -04:00
2024-02-08 09:35:39 -05:00
2024-01-04 11:53:38 +02:00
2024-02-08 09:35:39 -05:00
2025-04-02 13:35:14 -07:00
2025-04-11 17:19:38 +02:00
2024-02-08 09:35:39 -05:00
2025-04-02 13:35:14 -07:00
2025-03-24 17:44:43 +01:00
2025-03-24 17:44:43 +01:00
2025-05-20 15:52:27 +02:00
2025-06-26 19:37:16 +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-06-23 13:42:22 -04:00