emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TRAMP VC optimization fails: non-TRAMP filenames handled incorrectly


From: Michael Albinus
Subject: Re: TRAMP VC optimization fails: non-TRAMP filenames handled incorrectly in async operations.
Date: Fri, 29 Mar 2019 18:03:55 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Daniel Pittman <address@hidden> writes:

Hi Daniel,

>     Since I cannot reproduce the problem (yet), do you have a
>     backtrace?
>
> Sure, please see it follow.  I have censored the content of a small
> number of strings, but this is replacing a standard ASCII letter with
> 'X' so should have no semantic effect.  Sorry to have to do that.
> Fair warning, it is ... long.

Thanks! Could you pls send it next time as attachment? As text in the
message body, line breaks are set randomly, which makes it hard to read.

> The most interesting part is at the very start, where my `revert-file
> ` operation on a remote file triggers a `vc-refresh-state`, which ends
> up causing `tramp-send-string` to run `process-send-string`, and then
> a timer fires that drives the "deferred" third party library [1] to
> move on to running a background command, using the timeout(1) and p4
> (1) binaries to grab some state information.

Yes. Tramp fights indeed with timers, and so I have disabled timers in
tramp-accept-process-output already. Maybe we shall do the same in
tramp-send-string? Would the following patch help?

*** /tmp/ediffDh3DJa    2019-03-29 18:01:12.059246938 +0100
--- /home/albinus/src/tramp/lisp/tramp.el       2019-03-29 17:58:44.756196926 
+0100
***************
*** 4210,4216 ****
  the remote host use line-endings as defined in the variable
  `tramp-rsh-end-of-line'.  The communication buffer is erased before sending."
    (let* ((p (tramp-get-connection-process vec))
!        (chunksize (tramp-get-connection-property p "chunksize" nil)))
      (unless p
        (tramp-error
         vec 'file-error "Can't send string to remote host -- not logged in"))
--- 4210,4219 ----
  the remote host use line-endings as defined in the variable
  `tramp-rsh-end-of-line'.  The communication buffer is erased before sending."
    (let* ((p (tramp-get-connection-process vec))
!        (chunksize (tramp-get-connection-property p "chunksize" nil))
!        ;; We do not want to run timers.
!          (stimers (with-timeout-suspend))
!        timer-list timer-idle-list)
      (unless p
        (tramp-error
         vec 'file-error "Can't send string to remote host -- not logged in"))
***************
*** 4238,4244 ****
              (process-send-string
               p (substring string pos (min (+ pos chunksize) end)))
              (setq pos (+ pos chunksize))))
!       (process-send-string p string)))))

  (defun tramp-get-inode (vec)
    "Returns the virtual inode number.
--- 4241,4249 ----
              (process-send-string
               p (substring string pos (min (+ pos chunksize) end)))
              (setq pos (+ pos chunksize))))
!       (process-send-string p string))
!       ;; Reenable the timers.
!       (with-timeout-unsuspend stimers))))

  (defun tramp-get-inode (vec)
    "Returns the virtual inode number.
Best regards, Michael.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]