Commit 12d09be
authored
Tolerate slow or unreachable cross-node SharedDoc during session cleanup (#4845)
The collaborative editor Session calls SharedDoc.unobserve/1 during
cleanup, which issues a cross-node GenServer.call to a SharedDoc that may
live on another node. When that node is unreachable (:noconnection) or
slow to reply (:timeout), the call exited and crashed the Session; a
Phoenix channel blocked in save_workflow then inherited the exit and
dropped the client's editor connection.
Wrap both unobserve call sites (terminate/2 and the parent :DOWN handler)
in safe_unobserve/1, which catches the exit and logs at warning instead
of crashing. Skipping the unobserve is safe: the SharedDoc monitors each
observer and runs the same cleanup from its own :DOWN handler when the
Session dies.
Closes #48171 parent 2bfd363 commit 12d09be
3 files changed
Lines changed: 46 additions & 7 deletions
File tree
- lib/lightning/collaboration
- test/lightning/collaboration
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
45 | 51 | | |
46 | 52 | | |
47 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | | - | |
144 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
158 | 169 | | |
159 | 170 | | |
160 | 171 | | |
| |||
451 | 462 | | |
452 | 463 | | |
453 | 464 | | |
454 | | - | |
455 | | - | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
456 | 468 | | |
457 | | - | |
| 469 | + | |
458 | 470 | | |
459 | 471 | | |
460 | 472 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
655 | 655 | | |
656 | 656 | | |
657 | 657 | | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
658 | 679 | | |
659 | 680 | | |
660 | 681 | | |
| |||
0 commit comments