openshift-homeroom / workshop-dashboard

Adds content hosting to workshop terminals.
Apache License 2.0
47 stars 37 forks source link

execution of infinite while loops that prints quickly can result in queued output #40

Open kaovilai opened 5 years ago

kaovilai commented 5 years ago

I have an issue in the workshop below. thoraxe/istio-lab-summit-2019/issues/42

There might be a way to prevent queued up output that extend beyond what the user sees by slowing down execution. Otherwise it can cause user's Ctrl+C action to not be visible on their web terminal until a much later time.

GrahamDumpleton commented 5 years ago

It is generally an issue for any in browser terminal that uses web sockets, not just the terminal used here. Reasonably sure I would have warned you about this previously. You have to be very careful not to have users running commands that generate large amounts of output. Tailing logs of pods which log stuff on every web request and then running a HTTP benchmark against the web application would be quite bad, you just overwhelm the web socket connection and things will get back logged such that you can't get the interrupt through. You need to design the workshop to avoid doing anything that would cause such a problem. This is not like running a terminal on your local machine.

So, don't do stuff that generates lots of output or runs stuff in tight loops. That is all you can do.