Open lachrimae opened 5 months ago
The problem of not cleaning the server resources can be traced back to https://github.com/mthom/scryer-prolog/pull/1880/files#diff-a21834d24cd9843d97005c64c4a0568ae1f5df4043d26f528159f215ac2941dfR5225, where it was disabled to enable the library mode of Scryer Prolog. Some refactoring is required.
System specs
OS: Pop 22.04 jammy Kernel: x86_64 Linux 6.8.0-76060800daily20240311-generic CPU: 13th Gen Intel Core i5-1335U @ 12x 4.6GHz
Reproducing the issue
Start with a Prolog module
Then run
In a separate terminal, run
Expected outcome
The server should respond HTTP 500 with some kind of error message and continue to serve new HTTP requests.
What actually happens next
The
curl
session will hang until you issue the^C
kill command, suggesting that no HTTP response has been sent.Simultaneously, the
scryer-prolog
session will evaluate tofalse.
and quit out from evaluatinghttp_listen
. However, it is impossible to use^C
to exit the process at this point. If instead of trying to exit the process, you re-evaluatehttp_listen(8080, [post(/, handler)]).
then the Rust runtime will issue this panic message: