if (!SendMailToDCS())
Log("SHUTTLE", Form("ProcessCurrentDetector - "
- "Could not send mail to DCS experts!"));
+ "Could not send mail to DCS experts!"));
delete dcsMap;
return kFALSE;
if (!SendMailToDCS())
Log("SHUTTLE", Form("ProcessCurrentDetector - "
- "Could not send mail to DCS experts!"));
+ "Could not send mail to DCS experts!"));
if (aliasMap) delete aliasMap;
delete dcsMap;
if (fileSize.Length()>0)
{
// compare filesize of local file with the one stored in the FXS DB
- TString command=("stat --format=%s");
- Int_t sizeComp = gSystem->Exec(Form("%s %s |grep %s 2>&1 > /dev/null",
- command.Data(), localFileName.Data(),fileSize.Data()));
+ Long_t id,size,flags,mtime;
+ Int_t sizeComp = gSystem->GetPathInfo(localFileName.Data(),&id,&size,&flags,&mtime);
- if ( sizeComp != 0)
+ if ( sizeComp != 0 || size != fileSize.Atoi())
{
Log(detector, Form("GetFileName - size of file %s does not match with local copy!",
filePath.Data()));
if (fileChecksum.Length()>0)
{
// compare md5sum of local file with the one stored in the FXS DB
+ if(fileChecksum.Contains(' ')) fileChecksum.Resize(fileChecksum.First(' '));
Int_t md5Comp = gSystem->Exec(Form("md5sum %s |grep %s 2>&1 > /dev/null",
localFileName.Data(), fileChecksum.Data()));
#include <TMap.h>
#include <TObjString.h>
#include <TSystem.h>
+#include <TTimeStamp.h>
ClassImp(AliDCSClient)
Close();
- Int_t tries = 0;
+ Int_t tries = 0;
+ Int_t sleeptime=300;
+
while (tries < fRetries)
{
fSocket = new TSocket(fHost, fPort);
- if (fSocket->IsValid())
+
+ if (fSocket && fSocket->IsValid())
{
- AliDebug(1, Form("Connected to %s:%d", fHost.Data(), fPort));
+ AliDebug(1, Form("%s *** Connected to %s:%d", TTimeStamp(time(0)).AsString("s"), fHost.Data(), fPort));
fSocket->SetOption(kNoBlock, 1);
return kTRUE;
}
- AliDebug(1, Form("Connection timeout! tries <%d> ...", tries));
+ AliError(Form("%d *** Connection to AMANDA server failed! Tried <%d> times ...", tries+1));
+ if(tries<fRetries-1) AliInfo(Form("%d *** Waiting %d seconds before next retry.", sleeptime));
delete fSocket;
fSocket = NULL;
- gSystem->Sleep(fTimeout);
+ gSystem->Sleep(sleeptime);
tries ++;
}
while (sentSize < size && tries < fRetries) {
- Int_t sResult = fSocket->Select(TSocket::kWrite, fTimeout);
+ Int_t sResult = fSocket->Select(TSocket::kWrite, fTimeout*1000); //timeout for TSocket::Select is in msec
if (sResult == 0) {
AliDebug(1, Form("Timeout! tries <%d> ...", tries));
while (receivedSize < size && tries < fRetries) {
- Int_t sResult = fSocket->Select(TSocket::kRead, fTimeout);
+ Int_t sResult = fSocket->Select(TSocket::kRead, fTimeout*1000); //timeout for TSocket::Select is in msec
if (sResult == 0) {
+ AliDebug(1, Form("Time when timing out: %s Timeout value: %d seconds",TTimeStamp(time(0)).AsString("s"),fTimeout));
AliDebug(1, Form("Timeout! tries <%d> ...", tries));
tries ++;
continue;
//
if (fSocket) {
+ AliDebug(1, Form("%s *** Closing connection to %s:%d", TTimeStamp(time(0)).AsString("s"), fHost.Data(), fPort));
fSocket->Close();
delete fSocket;
fSocket = 0;