Skip to content
GitLab
Menu
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
cf633c7d
Commit
cf633c7d
authored
Aug 01, 2014
by
David COME
Browse files
ErrorFlag is now in castor::tape::tapeserver::daemon within its own file
parent
6b74f179
Changes
5
Hide whitespace changes
Inline
Side-by-side
castor/tape/tapeserver/daemon/DiskReadTask.cpp
View file @
cf633c7d
...
...
@@ -116,7 +116,7 @@ void DiskReadTask::execute(log::LogContext& lc) {
m_stats
.
filesCount
++
;
}
catch
(
const
castor
::
tape
::
excepti
on
s
::
ErrorFlag
&
){
catch
(
const
castor
::
tape
::
tapeserver
::
daem
on
::
ErrorFlag
&
){
lc
.
log
(
LOG_INFO
,
"DiskReadTask: a previous file has failed for migration "
"Do nothing except circulating blocks"
);
...
...
castor/tape/tapeserver/daemon/DiskReadTask.hpp
View file @
cf633c7d
...
...
@@ -26,6 +26,7 @@
#include "castor/tape/tapeserver/daemon/DataPipeline.hpp"
#include "castor/tape/tapeserver/daemon/DataConsumer.hpp"
#include "castor/tape/tapeserver/daemon/DiskStats.hpp"
#include "castor/tape/tapeserver/daemon/ErrorFlag.hpp"
#include "castor/tape/tapegateway/FileToMigrateStruct.hpp"
#include "castor/tape/tapeserver/threading/AtomicCounter.hpp"
#include "castor/log/LogContext.hpp"
...
...
@@ -66,7 +67,7 @@ private:
void
hasAnotherTaskTailed
()
const
{
//if a task has signaled an error, we stop our job
if
(
m_errorFlag
){
throw
castor
::
tape
::
excepti
on
s
::
ErrorFlag
();
throw
castor
::
tape
::
tapeserver
::
daem
on
::
ErrorFlag
();
}
}
...
...
castor/tape/tapeserver/daemon/ErrorFlag.hpp
0 → 100644
View file @
cf633c7d
/******************************************************************************
*
* This file is part of the Castor project.
* See http://castor.web.cern.ch/castor
*
* Copyright (C) 2003 CERN
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*
*
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
#pragma once
#include "castor/exception/Exception.hpp"
namespace
castor
{
namespace
tape
{
namespace
tapeserver
{
namespace
daemon
{
/**
* Used to signal an error has happened during the migration process
*/
class
ErrorFlag
:
public
castor
::
exception
::
Exception
{
public:
ErrorFlag
()
:
castor
::
exception
::
Exception
(
"Internal exception, should not be seen"
)
{}
virtual
~
ErrorFlag
()
throw
()
{}
};
}}}}
\ No newline at end of file
castor/tape/tapeserver/daemon/MigrationTaskInjector.cpp
View file @
cf633c7d
...
...
@@ -23,7 +23,8 @@
#include "castor/tape/tapeserver/daemon/MigrationTaskInjector.hpp"
#include "castor/tape/tapegateway/FilesToMigrateList.hpp"
#include "log.h"
#include "castor/tape/tapeserver/daemon/ErrorFlag.hpp"
//#include "log.h"
namespace
{
/*
...
...
@@ -189,7 +190,7 @@ namespace daemon {
try
{
while
(
1
){
if
(
m_parent
.
m_errorFlag
){
throw
castor
::
tape
::
excepti
on
s
::
ErrorFlag
();
throw
castor
::
tape
::
tapeserver
::
daem
on
::
ErrorFlag
();
}
Request
req
=
m_parent
.
m_queue
.
pop
();
client
::
ClientProxy
::
RequestReport
reqReport
;
...
...
@@ -210,7 +211,7 @@ namespace daemon {
}
}
//end of while(1)
}
//end of try
catch
(
const
castor
::
tape
::
excepti
on
s
::
ErrorFlag
&
){
catch
(
const
castor
::
tape
::
tapeserver
::
daem
on
::
ErrorFlag
&
){
//we end up there because a task screw up somewhere
m_parent
.
m_lc
.
log
(
LOG_ERR
,
"In MigrationTaskInjector::WorkerThread::run(): a task screw up, "
"finishing and discarding all tasks "
);
...
...
castor/tape/tapeserver/daemon/TapeWriteTask.cpp
View file @
cf633c7d
...
...
@@ -33,7 +33,7 @@
#include "castor/tape/tapeserver/daemon/MigrationReportPacker.hpp"
#include "castor/tape/tapeserver/daemon/TapeSessionStats.hpp"
#include "castor/tape/tapeserver/daemon/MemBlock.hpp"
#include "castor/tape/tapeserver/daemon/ErrorFlag.hpp"
namespace
castor
{
namespace
tape
{
namespace
tapeserver
{
...
...
@@ -119,7 +119,7 @@ namespace daemon {
// Add the local counts to the session's
stats
.
add
(
localStats
);
}
catch
(
const
castor
::
tape
::
excepti
on
s
::
ErrorFlag
&
){
catch
(
const
castor
::
tape
::
tapeserver
::
daem
on
::
ErrorFlag
&
){
//we end up there because another task has failed
//so we just log, circulate blocks and don't even send a report
lc
.
log
(
LOG_INFO
,
"TapeWriteTask: a previous file has failed for migration "
...
...
@@ -234,7 +234,7 @@ namespace daemon {
void
TapeWriteTask
::
hasAnotherTaskTailed
()
const
{
//if a task has signaled an error, we stop our job
if
(
m_errorFlag
){
throw
castor
::
tape
::
excepti
on
s
::
ErrorFlag
();
throw
castor
::
tape
::
tapeserver
::
daem
on
::
ErrorFlag
();
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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