[plt-scheme] Surprising behavior from "run-server"

From: Eric Hanchrow (offby1 at blarg.net)
Date: Wed Nov 7 11:02:59 EST 2007

>>>>> "Matthew" == Matthew Flatt <mflatt at cs.utah.edu> writes:

    Matthew> I think I don't understand the test.  It looks like you
    Matthew> have set up a server using `run-server' with a timeout of
    Matthew> 0.1 seconds on each connection.  The you create two
    Matthew> connections.  You ask the second one to get stuck, so the
    Matthew> associated handler thread on the server times out, and
    Matthew> the client gets back an EOF.

    Matthew> Since the timeout is the same for all connections, and
    Matthew> since the client waits for the one that gets stuck to
    Matthew> time out, then the other connection (the one created
    Matthew> first) also times out by then --- even though it's not
    Matthew> doing anything.

    Matthew> So, maybe the issue is that the timeout is wall-clock
    Matthew> time, not processor time?

Thank you for taking the time to look at this -- and for explaining
it!  I think you're right.  I was assuming that the thread which was
genuinely hung, had somehow "broken" the other thread, but what you
say makes sense -- the second thread merely timed out before the
client could get back to it.

To confirm this, I changed the test like this:

    -(send 'list-tables one-client)
    +(send 'list-tables (make-client))
    +(send 'die (make-client))

... and as I would expect, the freshly-created client has no trouble
"talking to" the server.

Humor can be dissected as a frog can, but the thing dies in the
process and the innards are discouraging to any but the pure
        --E.B. White

Posted on the users mailing list.