Commit 0d231fc8 authored by Steven Murray's avatar Steven Murray
Browse files

Modified the processing logic of the return of select so that the number of set

bits in the file descriptpor set is taken into account.
parent 20cc9575
......@@ -307,11 +307,11 @@ void castor::tape::aggregator::VdqmRequestHandlerThread::
//-----------------------------------------------------------------------------
// processTapeDiskIoConnections
// processTapeDiskIoConnection
//-----------------------------------------------------------------------------
void castor::tape::aggregator::VdqmRequestHandlerThread::
processTapeDiskIoConnections(const Cuuid_t &cuuid,
const RcpJobRequestMessage &vdqmJobRequest, std::list<int> &connectedSockets)
processTapeDiskIoConnection(const Cuuid_t &cuuid,
const RcpJobRequestMessage &vdqmJobRequest, const int connectedSocket)
throw(castor::exception::Exception) {
/*
// Give file information to RTCPD
......@@ -396,22 +396,36 @@ void castor::tape::aggregator::VdqmRequestHandlerThread::
}
break;
default: // One or more select file descriptors require attention
// If there is an incoming message on the initial RTCPD connection
if(FD_ISSET(rtcpdInitialSocketFd, &readFdSet)) {
// For each bit that has been set
for(int i=0; i<selectRc; i++) {
// If there is an incoming message on the initial RTCPD connection
if(FD_ISSET(rtcpdInitialSocketFd, &readFdSet)) {
processErrorOnInitialRtcpdConnection(cuuid, vdqmJobRequest,
rtcpdInitialSocketFd);
processErrorOnInitialRtcpdConnection(cuuid, vdqmJobRequest,
rtcpdInitialSocketFd);
// Else if there is a callback connection request from RTCPD
} else if(FD_ISSET(rtcpdCallbackSocketFd, &readFdSet)) {
FD_CLR(rtcpdInitialSocketFd, &readFdSet);
acceptRtcpdConnection(cuuid, vdqmJobRequest, rtcpdCallbackSocketFd,
connectedSockets);
// Else if there is a callback connection request from RTCPD
} else if(FD_ISSET(rtcpdCallbackSocketFd, &readFdSet)) {
// Else there are one or messages from the tape and disk I/O threads
} else {
processTapeDiskIoConnections(cuuid, vdqmJobRequest, connectedSockets);
}
acceptRtcpdConnection(cuuid, vdqmJobRequest, rtcpdCallbackSocketFd,
connectedSockets);
FD_CLR(rtcpdInitialSocketFd, &readFdSet);
// Else there are one or more messages from the tape/disk I/O threads
} else {
for(std::list<int>::iterator itor=connectedSockets.begin();
itor != connectedSockets.end(); itor++) {
processTapeDiskIoConnection(cuuid, vdqmJobRequest,
*itor);
FD_CLR(*itor, &readFdSet);
}
}
} // For each bit that has been set
}
}
} catch(castor::exception::Exception &ex) {
......
......@@ -141,15 +141,16 @@ namespace aggregator {
throw(castor::exception::Exception);
/**
* Processes the connected sockets of the tape and disk I/O threads.
* Processes the connected sockets of a tape and disk I/O thread.
*
* @param cuuid The ccuid to be used for logging.
* @param vdqmJobRequest The job request message received from the VDQM.
* @param connectedSockets In/out parameter - The list of connected sockets
* @param connectedSocket The connected socket of a tape and disk I/O
* thread.
*/
void processTapeDiskIoConnections(const Cuuid_t &cuuid,
const RcpJobRequestMessage &vdqmJobRequest,
std::list<int> &connectedSockets) throw(castor::exception::Exception);
void processTapeDiskIoConnection(const Cuuid_t &cuuid,
const RcpJobRequestMessage &vdqmJobRequest, const int connectedSocket)
throw(castor::exception::Exception);
/**
* Processes the following RTCPD sockets:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment