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
b13a81ba
Commit
b13a81ba
authored
Jul 09, 2014
by
Steven Murray
Browse files
Fixed DriveCatalogue::findConstDrive() throwing an exception when a drive had no pid
parent
470d232b
Changes
1
Hide whitespace changes
Inline
Side-by-side
castor/tape/tapeserver/daemon/DriveCatalogue.cpp
View file @
b13a81ba
...
...
@@ -39,8 +39,8 @@ castor::tape::tapeserver::daemon::DriveCatalogue::~DriveCatalogue() throw() {
const
DriveCatalogueEntry
*
drive
=
itor
->
second
;
if
(
DriveCatalogueEntry
::
SESSION_TYPE_LABEL
==
drive
->
getSessionType
()
&&
castor
::
tape
::
tapeserver
::
daemon
::
DriveCatalogueSession
::
SESSION_STATE_WAITFORK
==
drive
->
getSessionState
()
&&
-
1
!=
drive
->
getLabelCmdConnection
())
{
DriveCatalogueSession
::
SESSION_STATE_WAITFORK
==
drive
->
getSessionState
()
&&
-
1
!=
drive
->
getLabelCmdConnection
())
{
close
(
drive
->
getLabelCmdConnection
());
}
delete
drive
;
...
...
@@ -87,7 +87,7 @@ void castor::tape::tapeserver::daemon::DriveCatalogue::enterDriveConfig(
// If the drive is not in the catalogue
if
(
m_drives
.
end
()
==
itor
)
{
// Insert it
m_drives
[
driveConfig
.
unitName
]
=
new
castor
::
tape
::
tapeserver
::
daemon
::
DriveCatalogueEntry
(
driveConfig
,
m_drives
[
driveConfig
.
unitName
]
=
new
DriveCatalogueEntry
(
driveConfig
,
DriveCatalogueEntry
::
DRIVE_STATE_DOWN
);
// Else the drive is already in the catalogue
}
else
{
...
...
@@ -169,8 +169,8 @@ std::list<std::string> castor::tape::tapeserver::daemon::DriveCatalogue::getUnit
throw
ex
;
}
if
(
castor
::
tape
::
tapeserver
::
daemon
::
DriveCatalogueEntry
::
SESSION_TYPE_DATATRANSFER
==
drive
.
getSessionType
()
&&
castor
::
tape
::
tapeserver
::
daemon
::
DriveCatalogueSession
::
SESSION_STATE_WAITFORK
==
drive
.
getSessionState
())
{
if
(
DriveCatalogueEntry
::
SESSION_TYPE_DATATRANSFER
==
drive
.
getSessionType
()
&&
DriveCatalogueSession
::
SESSION_STATE_WAITFORK
==
drive
.
getSessionState
())
{
unitNames
.
push_back
(
itor
->
first
);
}
}
...
...
@@ -181,7 +181,8 @@ std::list<std::string> castor::tape::tapeserver::daemon::DriveCatalogue::getUnit
//-----------------------------------------------------------------------------
// getUnitNamesWaitingForLabelFork
//-----------------------------------------------------------------------------
std
::
list
<
std
::
string
>
castor
::
tape
::
tapeserver
::
daemon
::
DriveCatalogue
::
getUnitNamesWaitingForLabelFork
()
const
{
std
::
list
<
std
::
string
>
castor
::
tape
::
tapeserver
::
daemon
::
DriveCatalogue
::
getUnitNamesWaitingForLabelFork
()
const
{
std
::
list
<
std
::
string
>
unitNames
;
for
(
DriveMap
::
const_iterator
itor
=
m_drives
.
begin
();
...
...
@@ -200,8 +201,8 @@ std::list<std::string> castor::tape::tapeserver::daemon::DriveCatalogue::getUnit
throw
ex
;
}
if
(
castor
::
tape
::
tapeserver
::
daemon
::
DriveCatalogueEntry
::
SESSION_TYPE_LABEL
==
drive
.
getSessionType
()
&&
castor
::
tape
::
tapeserver
::
daemon
::
DriveCatalogueSession
::
SESSION_STATE_WAITFORK
==
drive
.
getSessionState
())
{
if
(
DriveCatalogueEntry
::
SESSION_TYPE_LABEL
==
drive
.
getSessionType
()
&&
DriveCatalogueSession
::
SESSION_STATE_WAITFORK
==
drive
.
getSessionState
())
{
unitNames
.
push_back
(
itor
->
first
);
}
}
...
...
@@ -249,8 +250,12 @@ const castor::tape::tapeserver::daemon::DriveCatalogueEntry
for
(
DriveMap
::
const_iterator
i
=
m_drives
.
begin
();
i
!=
m_drives
.
end
();
i
++
)
{
const
DriveCatalogueEntry
*
const
drive
=
i
->
second
;
if
(
sessionPid
==
drive
->
getSessionPid
())
{
return
drive
;
try
{
if
(
sessionPid
==
drive
->
getSessionPid
())
{
return
drive
;
}
}
catch
(...)
{
// Ignore any exceptions thrown by getSessionPid()
}
}
...
...
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