Subject: bug#61350: Eglot over Tramp freezes with large project

From: Stefan Monnier <[email-masked]>
Date: Wed, 15 Mar 2023 14:30:24 -0400

> We could start by understanding exactly what is triggering this reentrancy.
> AFAIU, we don't.  If have a recipe to trigger is consistently, now we should
> work backwards from there.

I think we understand some of the problems well enough to think
about solutions.

E.g. the case where we run a process filter for process P while we
haven't finished running a previous invocation of P's process filter.
[ While this tends to occur in hard-to-debug corner cases, it also
  tends to occur when Edebugging process filters.  ]

Another is that `process-send-string` should be more clear about its
asynchronous behavior: I'd argue that it should *never* block, but it
should additionally provide a way to check when the send is completed.

I suspect we also have some loose ends in timer handling, where we
should provide ways to distinguish "run every N seconds", "wait
N seconds between each run", and whether re-entrancy should be allowed
when running "every N seconds".

And I seem to remember seeing cases where upon a process's exit we run
the process sentinel before the last invocation of the process filter:
we should clarify the ordering of these things (where "these things"
should also include things like `process-live-p` and `process-status`).
I haven't bumped into such problem recently, so maybe they've been
fixed, but maybe it's just because I haven't played with those
tools recently (not sure what the doc says about these things either).

        Stefan