mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2026-09-10 07:46:51 -04:00
jsonrpc-shutdown: Ensure we wait whole timeout & increase timeout
* lisp/jsonrpc.el (jsonrpc-shutdown): Ensure that we wait for the whole timeout and increase the timeout to 300ms (bug#80140).
This commit is contained in:
parent
eb814fbb5c
commit
4f6b6f462c
|
|
@ -678,14 +678,16 @@ If CONN is not shutdown within a reasonable amount of time, warn
|
|||
and delete the network process."
|
||||
(unwind-protect
|
||||
(cl-loop
|
||||
with proc = (jsonrpc--process conn) for i from 0
|
||||
with proc = (jsonrpc--process conn)
|
||||
with grace = 0.3 with start = (float-time)
|
||||
for i from 0
|
||||
while (not (process-get proc 'jsonrpc-sentinel-cleanup-started))
|
||||
unless (zerop i) do
|
||||
unless (or (zerop i) (< (- (float-time) start) grace)) do
|
||||
(jsonrpc--warn "Sentinel for %s still hasn't run, deleting it!" proc)
|
||||
(delete-process proc)
|
||||
do
|
||||
;; Let sentinel have a chance to run
|
||||
(accept-process-output nil 0.1))
|
||||
(accept-process-output nil grace))
|
||||
(when cleanup
|
||||
(kill-buffer (process-buffer (jsonrpc--process conn)))
|
||||
(kill-buffer (jsonrpc-stderr-buffer conn)))))
|
||||
|
|
|
|||
Loading…
Reference in a new issue