Bug in timeout detection on the client for Windows

I’m at a workshop that has completly takend down the network connection - bandwidth is small and connections sometimes drop. I’m running W7, 64 bit, VS2010, and using a debug build of PROOF from the head of SVN.

In the file XrdSysPthread.cc there is the following code:

do {retc = pthread_cond_timedwait(&cvar, &cmut, &tval);} while (retc && (retc != ETIMEDOUT));

This becomes an infinite loop when a timeout occurs. When that occurs, retc is the value 10060, which is ETIMEDOUT as defined in pthread.h, but the test fails. It looks to me like ETIMEDOUT value is, instead, being picked up from errno.h (which is getting picked up from the MS distro).

At the top of your file you have:

#include <errno.h> #include <pthread.h>
I changed it to the following (I was scared there was some other dependency in include file order):

#include <errno.h> #ifdef WIN32 #undef ETIMEDOUT #endif #include <pthread.h>

This may not be the proper fix, but it seems to get past infinite loop bug I was seeing.

BTW, if anyone wants, the makefile for the xrdsys library misses the modificatoin of the source file, and also deleting the obj file. I had to delete the library to force make to re-run.



The fix has been committed into the trunk and Xrootd GIT head.
Thanks for bringing up the issue and providing a solution.


Thanks!! Of course, now I’m back on a good network, so I don’t see these errors any more. :slight_smile:

Is all of root thinking of moving to GIT? Wow! Very forward thinking!

Hi Gordon,

don’t spread any rumors :slight_smile: No, ROOT is not moving to git (yes, those italics were intentional, stay tuned). Xrootd did move, though.

Cheers, Axel.

:slight_smile: Thanks! You know me - I do my best to start only good rumors!