48#define TRACELINK dataLink
102 else Sched->Schedule(
this);
122 {
while((aioP =
pendQ))
129 if (
inFlight <= 0 || !Wait4Buff(maxWait))
break;
137 snprintf(buff,
sizeof(buff),
138 "aio%c overdue %d inflight request%s for",
164 TRACEP(
DEBUG,
"gdDone: "<<(
void *)
this<<
" pendWrite "
165 <<(pendWrite != 0 ?
"set":
"not set"));
178 TRACEP(
DEBUG,
"gdDone: "<<(
void *)
this<<
" ending rc="<<rc);
208 snprintf(eBuff,
sizeof(eBuff),
"link error aborted %s for",
Comment);
216 if (pendWrite) {pendWrite->Recycle(); pendWrite = 0;}
239do{
if ((aioP =
pendQ))
255 }
while(Wait4Buff());
261 :
"aio file write timed out"));
304 if (!eText) eText = (rc ?
XrdSysE2T(rc) :
"invalid error code");
308 snprintf(eBuff,
sizeof(eBuff),
"async %s failed for %s;",
338 snprintf(eBuff,
sizeof(eBuff),
"fs returned unexpected rc %d", rc);
368 ssize_t aioResult = aioP->
Result;
391 if (aioResult < aioLength)
394 {
if ((finalRead && aioOffset < finalRead->sfsAio.aio_offset)
399 {
SendError(ENODEV,
"embedded short block");
402 if (finalRead)
SendError(ENODEV,
"multiple short blocks");
403 else {finalRead = aioP;
414 if (finalRead && aioOffset >= finalRead->sfsAio.aio_offset)
415 {
SendError(ENODEV,
"read offset past EOD");
428bool XrdXrootdAioTask::Wait4Buff(
int maxWait)
430 static const int msgInterval = 30;
432 int aioWait, msgWait = msgInterval, totWait = 0;
436 if (
pendQ)
return true;
452 aioWait = (maxWait > msgInterval ? msgInterval : maxWait);
457 while(totWait < maxWait)
461 totWait = (time(0) - begWait);
462 int tmpWait = maxWait - totWait;
463 if (tmpWait > 0 && tmpWait < aioWait) aioWait = tmpWait;
464 if (totWait >= msgWait)
468 snprintf(buff,
sizeof(buff),
"%d tardy aio%c requests for",
XrdOucTrace * XrdXrootdTrace
const char * XrdSysE2T(int errcode)
static int mapError(int rc)
char * ID
Pointer to the client's link identity.
const char * getErrText()
void Reset()
Reset object to no message state. Call this method to release appendages.
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
static void Snooze(int seconds)
virtual void Recycle() override
virtual void Recycle(bool release)=0
bool Validate(XrdXrootdAioBuff *aioP)
XrdXrootdAioBuff * getBuff(bool wait)
void SendError(int rc, const char *eText)
void Completed(XrdXrootdAioBuff *aioP)
XrdXrootdResponse Response
void Init(XrdXrootdProtocol *protP, XrdXrootdResponse &resp, XrdXrootdFile *fP)
XrdXrootdAioBuff * pendQEnd
static const char * TraceID
XrdXrootdProtocol * Protocol
int getDump(const char *dtype, int dlen)