Commit db651f1
committed
fix(engine): give the ffmpeg children the signal that actually aborts them
The internal AbortController exists so a fatal FX error can cancel in-flight
ffmpeg before the finally-block deletes workDir. It reached the entry guard and
applyAudioFxChain, and nothing else: the trim, the video extract and the
download were all still handed the CALLER's signal. So `internalController
.abort()` cancelled nothing, and the `rmSync(workDir, { recursive: true })`
immediately after it ran while those children were still writing into the
directory.
Concretely: track A's FX render fails while track B is mid-trim, with no
external cancellation. B's ffmpeg keeps writing `${id}-trimmed.wav` into an
unlinked directory until it finishes. The comment above the controller
describes a mechanism that was never wired to the processes it names.
The download also had no signal at all, though downloadToTemp accepts one.
No test: the three changes are which variable is passed to a child process
helper, and observing the difference means driving real ffmpeg to the point of
cancellation. The old wiring's inertness is provable by reading — the caller's
signal is never aborted by this function — and the new wiring is the same three
calls with the controller the function already built.1 parent a56a03d commit db651f1
1 file changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
765 | 765 | | |
766 | 766 | | |
767 | 767 | | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
768 | 774 | | |
769 | 775 | | |
770 | 776 | | |
| |||
795 | 801 | | |
796 | 802 | | |
797 | 803 | | |
798 | | - | |
| 804 | + | |
799 | 805 | | |
800 | 806 | | |
801 | 807 | | |
| |||
842 | 848 | | |
843 | 849 | | |
844 | 850 | | |
845 | | - | |
| 851 | + | |
846 | 852 | | |
847 | 853 | | |
848 | 854 | | |
| |||
868 | 874 | | |
869 | 875 | | |
870 | 876 | | |
871 | | - | |
| 877 | + | |
872 | 878 | | |
873 | 879 | | |
874 | 880 | | |
| |||
0 commit comments