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
4ee57747
Commit
4ee57747
authored
Jul 25, 2017
by
Eric Cano
Browse files
Fixed function name in error strings.
parent
b09b0803
Changes
1
Hide whitespace changes
Inline
Side-by-side
scheduler/OStoreDB/MemQueues.hpp
View file @
4ee57747
...
...
@@ -202,7 +202,7 @@ std::shared_ptr<SharedQueueLock<Queue>> MemQueue<Request, Queue>::sharedAddToNew
utils
::
Timer
timer
;
// Re-check the queue is not there
if
(
g_queues
.
end
()
!=
g_queues
.
find
(
queueIndex
))
{
throw
cta
::
exception
::
Exception
(
"In Mem
Archive
Queue::sharedAddTo
ArchiveQueueWith
NewQueue(): the queue is present, while it should not!"
);
throw
cta
::
exception
::
Exception
(
"In MemQueue::sharedAddToNewQueue(): the queue is present, while it should not!"
);
}
// Create the queue and reference it.
auto
maq
=
(
g_queues
[
queueIndex
]
=
std
::
make_shared
<
MemQueue
>
());
...
...
@@ -215,7 +215,7 @@ std::shared_ptr<SharedQueueLock<Queue>> MemQueue<Request, Queue>::sharedAddToNew
try
{
futureFromPredecessor
=
std
::
move
(
g_futures
.
at
(
queueIndex
));
}
catch
(
std
::
out_of_range
&
)
{
throw
cta
::
exception
::
Exception
(
"In Mem
Archive
Queue::sharedAddTo
ArchiveQueueWith
NewQueue(): the future is not present, while it should!"
);
throw
cta
::
exception
::
Exception
(
"In MemQueue::sharedAddToNewQueue(): the future is not present, while it should!"
);
}
}
// Create the promise and future for successor.
...
...
@@ -235,10 +235,10 @@ std::shared_ptr<SharedQueueLock<Queue>> MemQueue<Request, Queue>::sharedAddToNew
// Remove the queue for our tape pool. It should be present.
try
{
if
(
g_queues
.
at
(
queueIndex
).
get
()
!=
maq
.
get
())
{
throw
cta
::
exception
::
Exception
(
"In Mem
Archive
Queue::sharedAddTo
ArchiveQueueWith
NewQueue(): the queue is not ours, while it should!"
);
throw
cta
::
exception
::
Exception
(
"In MemQueue::sharedAddToNewQueue(): the queue is not ours, while it should!"
);
}
}
catch
(
std
::
out_of_range
&
)
{
throw
cta
::
exception
::
Exception
(
"In Mem
Archive
Queue::sharedAddTo
ArchiveQueueWith
NewQueue(): the queue is not present, while it should!"
);
throw
cta
::
exception
::
Exception
(
"In MemQueue::sharedAddToNewQueue(): the queue is not present, while it should!"
);
}
// Checks are fine, let's just drop the queue from the map
g_queues
.
erase
(
queueIndex
);
...
...
@@ -295,7 +295,7 @@ std::shared_ptr<SharedQueueLock<Queue>> MemQueue<Request, Queue>::sharedAddToNew
.
add
(
"addedJobs"
,
addedJobs
)
.
add
(
"waitTime"
,
waitTime
)
.
add
(
"enqueueTime"
,
timer
.
secs
());
logContext
.
log
(
log
::
INFO
,
"In Mem
Archive
Queue::sharedAddTo
Archive
Queue(): added batch of jobs to the queue."
);
logContext
.
log
(
log
::
INFO
,
"In MemQueue::sharedAddTo
New
Queue(): added batch of jobs to the queue."
);
}
// We will also count how much time we mutually wait for the other threads.
ret
->
m_timer
.
reset
();
...
...
@@ -327,9 +327,9 @@ std::shared_ptr<SharedQueueLock<Queue>> MemQueue<Request, Queue>::sharedAddToNew
}
catch
(
cta
::
exception
::
Exception
&
ex
)
{
log
::
ScopedParamContainer
params
(
logContext
);
params
.
add
(
"message"
,
ex
.
getMessageValue
());
logContext
.
log
(
log
::
ERR
,
"In Mem
Archive
Queue::sharedAddTo
Archive
Queue(): got an exception writing. Will propagate to other threads."
);
logContext
.
log
(
log
::
ERR
,
"In MemQueue::sharedAddTo
New
Queue(): got an exception writing. Will propagate to other threads."
);
}
catch
(...)
{
logContext
.
log
(
log
::
ERR
,
"In Mem
Archive
Queue::sharedAddTo
Archive
Queue(): got a non cta exception writing. Will propagate to other threads."
);
logContext
.
log
(
log
::
ERR
,
"In MemQueue::sharedAddTo
New
Queue(): got a non cta exception writing. Will propagate to other threads."
);
}
size_t
exceptionsNotPassed
=
0
;
// Something went wrong. We should inform the other threads
...
...
@@ -348,13 +348,13 @@ std::shared_ptr<SharedQueueLock<Queue>> MemQueue<Request, Queue>::sharedAddToNew
std
::
rethrow_exception
(
std
::
current_exception
());
}
catch
(
std
::
exception
&
ex
)
{
std
::
stringstream
err
;
err
<<
"In Mem
Archive
Queue::sharedAddTo
Archive
Queue(), in main thread, failed to notify "
err
<<
"In MemQueue::sharedAddTo
New
Queue(), in main thread, failed to notify "
<<
exceptionsNotPassed
<<
" other threads out of "
<<
maq
->
m_requests
.
size
()
<<
" : "
<<
ex
.
what
();
log
::
ScopedParamContainer
params
(
logContext
);
params
.
add
(
"what"
,
ex
.
what
())
.
add
(
"exceptionsNotPassed"
,
exceptionsNotPassed
);
logContext
.
log
(
log
::
ERR
,
"In Mem
Archive
Queue::sharedAddTo
Archive
Queue(): Failed to propagate exceptions to other threads."
);
logContext
.
log
(
log
::
ERR
,
"In MemQueue::sharedAddTo
New
Queue(): Failed to propagate exceptions to other threads."
);
throw
cta
::
exception
::
Exception
(
err
.
str
());
}
...
...
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