rokucommunity / roku-debug

A compatibility wrapper around the BrightScript debug protocol https://developer.roku.com/en-ca/docs/developer-program/debugging/socket-based-debugger.md
MIT License
12 stars 9 forks source link

Fix `file already exists` error and hung process #152

Closed TwitchBronBron closed 1 year ago

TwitchBronBron commented 1 year ago

Fixes critical issue where subsequent debug sessions would fail with EXIST: file already exists, mkdir... errors, and would use significant amounts of the CPU.

The problem was introduced in v0.18.7 when we improved the error messaging around certain types of debug session failures.

The actual problem is that the .shutdown() call on debug session got into an infinite async loop. To solve this, we lock the .shutdown() call in a promise semaphore so we can only run shutdown once, the first time called.