OK, never mind a counter. How about adding a variable, tramp-retry-exec-attempt-delay or something, that we can set to 1 second.
One might think doing "sleep 1; exec ..." would work. But sending thousands of these might be ignored by the same shell that is ignoring the "exec ...". Therefore it needs to be added at the lisp level. I'm just saying that without turning on tracing, within a second a 52 Megabytes buffer is produced, also pretty much locking up ones CPU... At today's processor speeds one can imagine with tracing turned on via higher debug levels, the whole computer probably will need to be powercycled.
