Commit a401819
committed
fix(node): ignore stale port exits in trap_exit device servers
ThinPool, Img.Server, Layer.Server and Img.Mutable each run privileged
commands through `System.cmd`, which links a transient port to the caller
and returns only once the command has finished. Because these servers trap
exits (for `terminate/2` teardown), the now-defunct port's exit is then
delivered as `{:EXIT, port, reason}`. None of these servers define a
catch-all handle_info, so an unmatched `{:EXIT, ...}` raises a
FunctionClauseError and crash-loops the server -- Layer.Server crashed
while mounting a layer, which surfaced to create_vm as :no_capacity.
Match the port specifically (`is_port/1`) and ignore it regardless of
reason: the synchronous `System.cmd` has already consumed the command's
result, so the trailing port exit is stale by construction whether it
closed normally or not. A linked *process* exiting is a genuinely
different event and still falls through (and raises), so real faults are
not masked.1 parent 9ee5de4 commit a401819
4 files changed
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
122 | 130 | | |
123 | 131 | | |
124 | 132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
131 | 139 | | |
132 | 140 | | |
133 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
97 | 105 | | |
98 | 106 | | |
99 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
122 | 130 | | |
123 | 131 | | |
124 | 132 | | |
| |||
0 commit comments