radian-software / riju

⚡ Extremely fast online playground for every programming language.
https://riju.codes
MIT License
1.64k stars 191 forks source link

REPL output sometimes cuts off/drops early #164

Open kwshi opened 2 years ago

kwshi commented 2 years ago

Sometimes, the REPL doesn't print output that it's supposed to print, and the program prematurely ends before all output has been sent. Example-- the following program prints 0 through 9; when this program is run, most of the times the correct output is shown but sometimes, seemingly at random, the output cuts off early:

image

Inspecting the websocket message log shows the following exchange:

So it seems like the missing output is not transmitted at all by the server, rather than it being hidden by some UI-level bug.

(Another example, in which the last output line hello is dropped:) image

raxod502 commented 2 years ago

Huh, that's very odd, I'm not sure what could be causing this. The process management code needs a serious rewrite, I suspect it has a number of potential race conditions because I wrote my own thing instead of using an existing container runtime like Kubernetes.