Commit 461e7ac
Fix unbounded thread pool in OVN MaintenanceThread
Change-Id Ie01fd776 (commit d98d028) switched
MaintenanceThread's PeriodicWorker from the default
SynchronousExecutor to futurist.ThreadPoolExecutor, passing the
class as a bare reference without specifying max_workers.
When max_workers is unset, futurist.ThreadPoolExecutor defaults to
os.cpu_count() * 5 (480 on a 96-CPU node). The executor's
_maybe_spin_up() creates a new idle worker thread on every submit()
call, and futurist.ThreadPoolExecutor never shrinks its pool.
Threads accumulate indefinitely until RuntimeError: can't start new
thread.
Since PeriodicWorker runs periodic tasks sequentially (one at a
time), only a single worker thread is needed. Bound max_workers=1
to prevent thread accumulation.
Closes-Bug: #2149830
Related-Bug: #2097257
Generated-By: claude-opus-4-6 (OpenCode)
Signed-off-by: Adam Harwell <flux.adam@gmail.com>
Change-Id: Id0b71902a7dc842f2190b310a222f49f39db91ba
(cherry picked from commit 153db8a)1 parent 6f49b3b commit 461e7ac
2 files changed
Lines changed: 47 additions & 1 deletion
File tree
- neutron
- plugins/ml2/drivers/ovn/mech_driver/ovsdb
- tests/unit/plugins/ml2/drivers/ovn/mech_driver/ovsdb
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
| 108 | + | |
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
| |||
Lines changed: 45 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
38 | 83 | | |
39 | 84 | | |
40 | 85 | | |
| |||
0 commit comments