Skip to content
Snippets Groups Projects
Commit dc3a0303 authored by Steven Murray's avatar Steven Murray
Browse files

bug #101907: The 55 second timeouts of tapebridged are not working

Fixed in the trunk.
parent 11118c1a
No related branches found
No related tags found
No related merge requests found
......@@ -386,27 +386,22 @@ int castor::tape::tapebridge::BridgeSocketCatalogue::
void castor::tape::tapebridge::BridgeSocketCatalogue::checkForTimeout() const
throw(castor::exception::TimeOut) {
if(!m_clientReqHistory.empty()) {
// If the "get more work" socket-descriptor has already been set
if(0 <= m_getMoreWorkConnection.clientSock) {
// Get the current time
struct timeval now = {0, 0};
gettimeofday(&now, NULL);
// Get the oldest client request
const ClientReqHistoryElement &clientRequest = m_clientReqHistory.front();
// Calculate the age in seconds
const int ageSecs = clientRequest.clientReqTimeStamp.tv_sec - now.tv_sec;
const int ageSecs = now.tv_sec -
m_getMoreWorkConnection.clientReqTimeStamp.tv_sec;
// Throw an exception if the oldest client-request has been around too long
if(ageSecs > CLIENTNETRWTIMEOUT) {
castor::exception::TimeOut te;
te.getMessage() <<
"Timed out waiting for client reply"
": clientSock=" << clientRequest.clientSock <<
": clientSock=" << m_getMoreWorkConnection.clientSock <<
": ageSecs=" << ageSecs <<
": clientNetRWTimeout=" << CLIENTNETRWTIMEOUT;
......@@ -530,10 +525,6 @@ void castor::tape::tapebridge::BridgeSocketCatalogue::
m_getMoreWorkConnection.clientSock = clientSock;
m_getMoreWorkConnection.tapebridgeTransId = tapebridgeTransId;
gettimeofday(&(m_getMoreWorkConnection.clientReqTimeStamp), NULL);
// Store an entry in the client request history
m_clientReqHistory.push_back(ClientReqHistoryElement(clientSock,
m_getMoreWorkConnection.clientReqTimeStamp));
}
......
......@@ -467,39 +467,6 @@ private:
*/
std::set<int> m_rtcpdIOControlConns;
/**
* Information about a single client request to be used to create a history
* about sent and pending client requests.
*/
struct ClientReqHistoryElement {
const int clientSock;
const struct timeval clientReqTimeStamp;
/**
* Constructor.
*/
ClientReqHistoryElement(
const int cSock,
const struct timeval cReqTimeStamp) :
clientSock(cSock),
clientReqTimeStamp(cReqTimeStamp) {
}
};
/**
* Type used to define a list of client request history elements.
*/
typedef std::list<ClientReqHistoryElement> ClientReqHistoryList;
/**
* The history of pending client requests implemented as a time-ordered FIFO,
* where the oldest request is at the front and the youngest at the back.
*
* This history is used to efficiently determine if an rtcpd-connection has
* timed out waiting for a reply from a client.
*/
ClientReqHistoryList m_clientReqHistory;
/**
* The pending client migration-report connection.
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment