socket synchronization (was "Celeste sending/fetching mail with Michaels refactored clients")

Michael Rueger m.rueger at acm.org
Tue Nov 19 17:17:12 UTC 2002


Hi,

this is the original bug report I sent:

> 
> in my network rewrite code I inserted a short delay in 
> Socket>>waitForDataUntil: .
> 
> Without this delay the code sometimes hangs in the FTPClientTest suite. 
> It seems to be more reliably reproducable with slower ftp site.
> Platform Win2k.

Anyways. The way I arrived at this hack was while running the ftp test 
suite that comes with the network rewrite (see SqueakMap for the 
location). It reproducable hang (newest VM, Win2k, T1 connection) while 
waiting on the ReadSemaphore in waitForDataUntil: I then inserted 
Transcript messages before and after the semaphore wait message to see 
what's going on and it suddenly worked. That's why I ended up putting in 
that delay and posted the bug report.

I know this delay doesn't make sense even without knowing the underlying 
Socket code.

I'll remove it in the next iteration and see if and how many people 
holler...

Michael



Andreas.Raab at gmx.de wrote:
> Okay, I just checked some code and the delay makes no sense whatsoever to
> me. Try taking it out. The only issue that it _might_ be related to (but it is
> not clear to me how) is that incorrectly written client code might loop
> endlessly under certain conditions if it does not check for errors during tight
> loops of reading data. Because this has been a problem in some cases, I changed
> the primitive to FAIL (instead of silently returning that no data has been
> read).
> 
> In any case, the delay makes no sense. If there's a problem let me know but
> make sure you got the latest VM.
> 
> Cheers,
>   - Andreas
> 
> 
>>>The 10ms delay (actually in the Socket code) is a workaround for the 
>>>semaphore timeout seeming to hang occasionally at least on Windows.
>>
>>Hm... a bit more information would be helpful. "seeming to hang
>>occasionally" is not very descriptive. Does it hang? If so, where? What
>>happens if you do
>>a "print network state" from the VMs debug menu? Any particular test case
>>where it does hang (even if occasionally)? Platforms this was found on?
>>
>>Cheers,
>>  - Andreas
>>
> 
> 





More information about the Squeak-dev mailing list