[E-Lang] remote comms: Timeouts and Connection Failure
Marc Stiegler
marcs@skyhunter.com
Fri, 20 Apr 2001 09:38:31 -0700
Alan Karp wrote:
> > This situation is rare if you are thinking of "connection" failures, but
it
> > is a common symptom of logic errors in the sending program. Normally
> > keepalives are sent by the low-level messaging code, while the message
> > you're expecting is coming from the application. If the application
gets
> > stuck in a loop, or misinterprets the request as something that needs no
> > reply, you'll get your keepalives but not your message. Maybe I write
> > particularly bad code, but I see this behavior much more frequently than
an
> > undetected lost connection.
This ratio of many application failures per "connection" failure could be
caused by either bad code or good connections; in this case, I am just sure
that you are writing excellent code, but are experiencing truly spectacular
connections :-). I, on the other hand, may write bad code, but I have truly
appalling connections, so for me the keepalive stream still works as a
reasonable default policy :-) As I said in another thread, if E didn't
supply a keepalive stream impatience policy, I would have to write one.
Actually, even when I factor out failures of the comm infrastructure (like
getting dial tone on my modem line in the middle of communication), the
servers I connect to are more likely to crash than my E applications are
likely to get locked up. I do not think this is because of my own personal
wizardry. E shares with Smalltalk the characteristic that iteration through
a collection requires no human intervention to "getNext" (unlike the Java
Enumeration class). This small detail eliminates the bulk of infinite loops
(well, the bulk of my infinite loops, anyway: my Smalltalk programs never
got into infinite loops either). And of course E doesn't get caught in
thread-based deadlocks either. So about the only common way you can lock up
an E program is by screwing up a "while" loop, of which I seem to write
extremely few in E (don't know why, but so far it is true :-)
--marcs