You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In jupyter-kernel-process.el function jupyter--start-kernel-process checks the connection file conn-file 's atime to avoid bugs where jupyter starts kernels using the same port in a loop.
Obviously this does not work if the disk as been mounted with noatime which is quite common with SSDs nowadays.
A quick fix is to use a boolean variable jupyter--use-conn-file-atime. On linux, parsing the output of mount or /proc/mounts would be cool...
Temporary fix (only change in jupyter--start-kernel-process is the (not (jupyter--use-conn-file-atime))) line:
(defvarjupyter--use-conn-file-atimenil"Whether to use the access time of the connexion file to check kernel process start up")
(defunjupyter--start-kernel-process (namekernelspecconn-file)
(let* ((process-name (format"jupyter-kernel-%s" name))
(buffer-name (format" *jupyter-kernel[%s]*" name))
(process-environment
(append (jupyter-process-environment kernelspec)
process-environment))
(args (jupyter-kernel-argv kernelspec conn-file))
(atime (nth4 (file-attributes conn-file)))
(process (apply#'start-file-process process-name
(generate-new-buffer buffer-name)
(car args) (cdr args))))
(set-process-query-on-exit-flag process jupyter--debug)
;; Wait until the connection file has been read before returning.;; This is to give the kernel a chance to setup before sending it;; messages.;;;; TODO: Replace with a check of the heartbeat channel.
(jupyter-with-timeout
((format"Starting %s kernel process..." name)
jupyter-long-timeout
(unless (process-live-p process)
(error"Kernel process exited:\n%s"
(with-current-buffer (process-buffer process)
(ansi-color-apply (buffer-string))))))
;; Windows systems may not have good time resolution when retrieving;; the last access time of a file so we don't bother with checking that;; the kernel has read the connection file and leave it to the;; downstream initialization to ensure that we can communicate with a;; kernel.
(or (not (jupyter--use-conn-file-atime))
(memq system-type '(ms-dos windows-nt cygwin))
(let ((attribs (file-attributes conn-file)))
;; `file-attributes' can potentially return nil, in this case;; just assume it has read the connection file so that we can;; know for sure it is not connected if it fails to respond to;; any messages we send it.
(or (null attribs)
(not (equal atime (nth4 attribs)))))))
(jupyter--gc-kernel-processes)
(push (list process conn-file) jupyter--kernel-processes)
process))```
The text was updated successfully, but these errors were encountered:
In
jupyter-kernel-process.el
functionjupyter--start-kernel-process
checks the connection fileconn-file
's atime to avoid bugs where jupyter starts kernels using the same port in a loop.Obviously this does not work if the disk as been mounted with noatime which is quite common with SSDs nowadays.
A quick fix is to use a boolean variable
jupyter--use-conn-file-atime
. On linux, parsing the output of mount or /proc/mounts would be cool...Temporary fix (only change in
jupyter--start-kernel-process
is the(not (jupyter--use-conn-file-atime))
) line:The text was updated successfully, but these errors were encountered: