alive-lsp icon indicating copy to clipboard operation
alive-lsp copied to clipboard

Difficulty killing runaway threads

Open madkins23 opened this issue 1 year ago • 1 comments

The following:

(in-package :cl-user)

(defun infinity ()
  (loop do (progn (print "Hello, World!")) (sleep 1)))

(infinity)

can be killed using the Threads tree view without any issue. It happens immediately.

Removing the sleep call:

(in-package :cl-user)

(defun infinity ()
  (loop do (progn (print "Hello, World!"))))

(infinity)

seems to lock up the LSP, making it virtually impossible to kill the thread. It is necessary to restart the LSP using Developer: Reload Window or kill VSCode and restart it. Even that takes a non-trivial amount of time.

There may be nothing to do here other than avoiding code with tight infinite loops.

madkins23 avatar May 20 '23 12:05 madkins23

Interesting (or not):

(defun crap ()
  (loop))

(crap)

does not lock up the LSP. There is a thread that doesn't go away but it can be killed.

madkins23 avatar May 20 '23 13:05 madkins23