Page MenuHomeDevCentral

Spawn a process should be executed asynchronously
Open, HighPublic

Description

T2214#34707 shows 14 to 15 minutes of foreground execution of a bogus youtube-dl command.

Currently, the source code spawns a process with TCL exec, blocking the main thread, then when the process is finished, the normal event-based flow of the program goes on.

That creates a whole family of potential timeout bugs where a bogus command can make the service unavailable for 15 minutes, but also a less responsive experience and a feeling "the bot lags" for 2-5 seconds of process.

Instead, we could use TCL 8.6 coroutine capabilities leveraged by the async package: https://wiki.tcl-lang.org/page/async

Event Timeline

dereckson triaged this task as High priority.Sat, Feb 14, 12:01
dereckson created this task.