Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
2d4f7eb1
Commit
2d4f7eb1
authored
Oct 29, 2014
by
Eric Cano
Browse files
Added logs for file opening (tape reads) and closing (disk writes)
parent
d86843c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
castor/tape/tapeserver/daemon/DiskWriteTask.cpp
View file @
2d4f7eb1
...
...
@@ -104,7 +104,7 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc,
reporter
.
reportCompletedJob
(
*
m_recallingFile
,
checksum
,
m_stats
.
dataVolume
);
m_stats
.
waitReportingTime
+=
localTime
.
secs
(
castor
::
utils
::
Timer
::
resetCounter
);
m_stats
.
totalTime
=
totalTime
.
secs
();
logWithStat
(
LOG_
DEBUG
,
"File successfully transfered to disk"
,
lc
);
logWithStat
(
LOG_
INFO
,
"File successfully transfered to disk"
,
lc
);
//everything went well, return true
return
true
;
...
...
castor/tape/tapeserver/daemon/TapeReadTask.hpp
View file @
2d4f7eb1
...
...
@@ -90,6 +90,11 @@ public:
MemBlock
*
mb
=
NULL
;
try
{
std
::
auto_ptr
<
castor
::
tape
::
tapeFile
::
ReadFile
>
rf
(
openReadFile
(
rs
,
lc
));
log
::
ScopedParamContainer
params
(
lc
);
params
.
add
(
"fileid"
,
m_fileToRecall
->
fileid
())
.
add
(
"fseq"
,
m_fileToRecall
->
fseq
())
.
add
(
"fileTransactionId"
,
m_fileToRecall
->
fileTransactionId
());
lc
.
log
(
LOG_INFO
,
"Successfully positioned for reading"
);
localStats
.
positionTime
+=
timer
.
secs
(
castor
::
utils
::
Timer
::
resetCounter
);
watchdog
.
notifyBeginNewJob
(
*
m_fileToRecall
);
localStats
.
waitReportingTime
+=
timer
.
secs
(
castor
::
utils
::
Timer
::
resetCounter
);
...
...
@@ -130,7 +135,6 @@ public:
// Hardcoded header size for lack of a better mechanism
// Head + trailer, 3 * 80 bytes each
localStats
.
headerVolume
=
(
2
*
3
*
80
);
log
::
ScopedParamContainer
params
(
lc
);
params
.
addTiming
(
"positionTime"
,
localStats
.
positionTime
)
.
addTiming
(
"transferTime"
,
localStats
.
transferTime
)
.
addTiming
(
"waitFreeMemoryTime"
,
localStats
.
waitFreeMemoryTime
)
...
...
@@ -141,24 +145,21 @@ public:
localStats
.
totalTime
?
(
1.0
*
localStats
.
dataVolume
+
1.0
*
localStats
.
headerVolume
)
/
1000
/
1000
/
localStats
.
totalTime
:
0
)
.
add
(
"payloadTransferSpeedMBps"
,
localStats
.
totalTime
?
1.0
*
localStats
.
dataVolume
/
1000
/
1000
/
localStats
.
totalTime
:
0
)
.
add
(
"fileid"
,
m_fileToRecall
->
fileid
())
.
add
(
"fseq"
,
m_fileToRecall
->
fseq
())
.
add
(
"fileTransactionId"
,
m_fileToRecall
->
fileTransactionId
());
localStats
.
totalTime
?
1.0
*
localStats
.
dataVolume
/
1000
/
1000
/
localStats
.
totalTime
:
0
);
lc
.
log
(
LOG_INFO
,
"File successfully read from drive"
);
// Add the local counts to the session's
stats
.
add
(
localStats
);
}
//end of try
catch
(
const
castor
::
exception
::
Exception
&
ex
)
{
//we end up there because :
//-- openReadFile brought us here (cant p
ut the tape into position
)
//-- openReadFile brought us here (cant p
osition to the file
)
//-- m_payload.append brought us here (error while reading the file)
// This is an error case. Log and signal to the disk write task
{
castor
::
log
::
LogContext
::
ScopedParam
sp0
(
lc
,
Param
(
"fileBlock"
,
fileBlock
));
castor
::
log
::
LogContext
::
ScopedParam
sp1
(
lc
,
Param
(
"ErrorMessage"
,
ex
.
getMessageValue
()));
castor
::
log
::
LogContext
::
ScopedParam
sp2
(
lc
,
Param
(
"ErrorCode"
,
ex
.
code
()));
lc
.
log
(
LOG_ERR
,
"Error reading a file
block
in TapeReadFileTask (backtrace follows)"
);
lc
.
log
(
LOG_ERR
,
"Error reading a file in TapeReadFileTask (backtrace follows)"
);
}
{
castor
::
log
::
LogContext
lc2
(
lc
.
logger
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment