Commit 91e32fc3 authored by Steven Murray's avatar Steven Murray
Browse files

Added the castor configuration parameter RMC:MAXRQSTATTEMPTS

parent a0af4080
......@@ -458,8 +458,8 @@
## Tape ########################################################################
#RMC PORT 5014 # TCP port for RMC daemon and client
# to work with (5014 is the default)
#RMC PORT 5014 # TCP port for RMC daemon and client
#RMC MAXRQSTATTEMPTS 10 # Maximum number of attempts a retriable RMC request should be issued
# To switch the smc logic to a Spectra like library LIBRARY_TYPE SPECTRA should
# be used. It fixs outputs for the smc command line tools and disables not
......
......@@ -31,10 +31,13 @@
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
castor::legacymsg::RmcProxyTcpIp::RmcProxyTcpIp(const unsigned short rmcPort,
const int netTimeout) throw():
castor::legacymsg::RmcProxyTcpIp::RmcProxyTcpIp(
const unsigned short rmcPort,
const int netTimeout,
const unsigned int maxRqstAttempts) throw():
m_rmcPort(rmcPort),
m_netTimeout(netTimeout) {
m_netTimeout(netTimeout),
m_maxRqstAttempts(maxRqstAttempts) {
}
//------------------------------------------------------------------------------
......@@ -64,7 +67,7 @@ void castor::legacymsg::RmcProxyTcpIp::mountTapeReadWrite(
castor::utils::copyString(rqstBody.vid, vid);
rqstBody.drvOrd = librarySlot.getDrvOrd();
rmcSendRecvNbAttempts(RMC_MAXATTEMPTS, librarySlot.getRmcHostName(),
rmcSendRecvNbAttempts(m_maxRqstAttempts, librarySlot.getRmcHostName(),
rqstBody);
} catch(castor::exception::Exception &ne) {
castor::exception::Exception ex;
......@@ -89,7 +92,7 @@ void castor::legacymsg::RmcProxyTcpIp::dismountTape(const std::string &vid,
rqstBody.drvOrd = librarySlot.getDrvOrd();
rqstBody.force = 0;
rmcSendRecvNbAttempts(RMC_MAXATTEMPTS, librarySlot.getRmcHostName(),
rmcSendRecvNbAttempts(m_maxRqstAttempts, librarySlot.getRmcHostName(),
rqstBody);
} catch(castor::exception::Exception &ne) {
castor::exception::Exception ex;
......
......@@ -49,8 +49,13 @@ public:
* @param rmcPort The TCP/IP port on which the rmcd daemon is listening.
* @param netTimeout The timeout in seconds to be applied when performing
* network read and write operations.
* @parm maxRqstAttempts The maximum number of attempts a retriable RMC
* request should be issued.
*/
RmcProxyTcpIp(const unsigned short rmcPort, const int netTimeout) throw();
RmcProxyTcpIp(
const unsigned short rmcPort,
const int netTimeout,
const unsigned int maxRqstAttempts) throw();
/**
* Destructor.
......@@ -111,11 +116,6 @@ protected:
*/
static const int RMC_MSGBUFSIZ = 256;
/**
* The maximum number of attempts a retriable RMC request should be issued.
*/
static const int RMC_MAXATTEMPTS = 10;
/**
* The TCP/IP port on which the rmcd daemon is listening.
*/
......@@ -127,6 +127,11 @@ protected:
*/
const int m_netTimeout;
/**
* The maximum number of attempts a retriable RMC request should be issued.
*/
const unsigned int m_maxRqstAttempts;
/**
* Connects to the rmcd daemon.
*
......
......@@ -100,11 +100,14 @@ static int exceptionThrowingMain(const int argc, char *const *const argv) {
const unsigned short rmcPort = castorConf.getConfEntInt("RMC", "PORT",
(unsigned short)RMC_PORT);
const unsigned int rmcMaxRqstAttempts = castorConf.getConfEntInt("RMC",
"MAXRQSTATTEMPTS", (unsigned int)RMC_MAXRQSTATTEMPTS);
// The network timeout of rmc communications should be several minutes due
// to the time it takes to mount and unmount tapes
const int rmcNetTimeout = 600; // Timeout in seconds
legacymsg::RmcProxyTcpIp rmc(rmcPort, rmcNetTimeout);
legacymsg::RmcProxyTcpIp rmc(rmcPort, rmcNetTimeout, rmcMaxRqstAttempts);
mediachanger::MediaChangerFacade mc(acs, mmc, rmc);
......
......@@ -98,11 +98,14 @@ static int exceptionThrowingMain(const int argc, char *const *const argv) {
const unsigned short rmcPort = castorConf.getConfEntInt("RMC", "PORT",
(unsigned short)RMC_PORT);
const unsigned int rmcMaxRqstAttempts = castorConf.getConfEntInt("RMC",
"MAXRQSTATTEMPTS", (unsigned int)RMC_MAXRQSTATTEMPTS);
// The network timeout of rmc communications should be several minutes due
// to the time it takes to mount and unmount tapes
const int rmcNetTimeout = 600; // Timeout in seconds
legacymsg::RmcProxyTcpIp rmc(rmcPort, rmcNetTimeout);
legacymsg::RmcProxyTcpIp rmc(rmcPort, rmcNetTimeout, rmcMaxRqstAttempts);
mediachanger::MediaChangerFacade mc(acs, mmc, rmc);
......
......@@ -480,7 +480,9 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
// The network timeout of rmc communications should be several minutes due
// to the time it takes to mount and unmount tapes
const int rmcNetTimeout = 600; // Timeout in seconds
legacymsg::RmcProxyTcpIp rmc(m_config.rmcPort, rmcNetTimeout);
legacymsg::RmcProxyTcpIp rmc(m_config.rmcPort, rmcNetTimeout,
m_config.rmcMaxRqstAttempts);
mediachanger::MediaChangerFacade mediaChangerFacade(acs, mmc, rmc);
......@@ -534,7 +536,9 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
// The network timeout of rmc communications should be several minutes due
// to the time it takes to mount and unmount tapes
const int rmcNetTimeout = 600; // Timeout in seconds
legacymsg::RmcProxyTcpIp rmc(m_config.rmcPort, rmcNetTimeout);
legacymsg::RmcProxyTcpIp rmc(m_config.rmcPort, rmcNetTimeout,
m_config.rmcMaxRqstAttempts);
mediachanger::MediaChangerFacade mediaChangerFacade(acs, mmc, rmc);
......@@ -857,7 +861,9 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
// The network timeout of rmc communications should be several minutes due
// to the time it takes to mount and unmount tapes
const int rmcNetTimeout = 600; // Timeout in seconds
legacymsg::RmcProxyTcpIp rmc(m_config.rmcPort, rmcNetTimeout);
legacymsg::RmcProxyTcpIp rmc(m_config.rmcPort, rmcNetTimeout,
m_config.rmcMaxRqstAttempts);
mediachanger::MediaChangerFacade mediaChangerFacade(acs, mmc, rmc);
......
......@@ -31,6 +31,7 @@
//------------------------------------------------------------------------------
castor::tape::tapeserver::daemon::TapeDaemonConfig::TapeDaemonConfig():
rmcPort(0),
rmcMaxRqstAttempts(0),
jobPort(0),
adminPort(0),
labelPort(0),
......@@ -54,6 +55,8 @@ castor::tape::tapeserver::daemon::TapeDaemonConfig
config.vmgrHost = castorConf.getConfEntString("VMGR", "HOST", log);
config.rmcPort = castorConf.getConfEntInt("RMC", "PORT",
(unsigned short)RMC_PORT, log);
config.rmcMaxRqstAttempts = castorConf.getConfEntInt("RMC",
"MAXRQSTATTEMPTS", (unsigned int)RMC_MAXRQSTATTEMPTS, log);
config.jobPort = castorConf.getConfEntInt("TapeServer", "JobPort",
TAPESERVER_JOB_PORT, log);
config.adminPort = castorConf.getConfEntInt("TapeServer", "AdminPort",
......
......@@ -67,6 +67,11 @@ struct TapeDaemonConfig {
*/
unsigned short rmcPort;
/**
* The maximum number of attempts a retriable RMC request should be issued.
*/
unsigned int rmcMaxRqstAttempts;
/**
* The TCP/IP port on which the tape server daemon listens for incoming
* connections from the VDQM server.
......
......@@ -24,6 +24,8 @@
#define RMC_PORT 5014
#define RMC_MAXRQSTATTEMPTS 10 /* Maximum number of attempts a retriable RMC request should be issued */
/* SCSI media changer utilities exit codes */
#define USERR 1 /* user error */
......
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