Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dCache
cta
Commits
7606a797
Commit
7606a797
authored
7 years ago
by
Michael Davis
Browse files
Options
Downloads
Patches
Plain Diff
[EOS-CTA] Adds 15-second timeout to Execute() wait_for Finished()
parent
cb598305
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
xroot_ssi_pb/XrdSsiPbRequestProc.hpp
+9
-1
9 additions, 1 deletion
xroot_ssi_pb/XrdSsiPbRequestProc.hpp
with
9 additions
and
1 deletion
xroot_ssi_pb/XrdSsiPbRequestProc.hpp
+
9
−
1
View file @
7606a797
...
...
@@ -135,6 +135,8 @@ private:
template
<
typename
RequestType
,
typename
MetadataType
,
typename
AlertType
>
void
RequestProc
<
RequestType
,
MetadataType
,
AlertType
>::
Execute
()
{
const
int
ExecuteTimeout
=
15
;
//< Maximum no. of seconds to wait before deleting myself
#ifdef XRDSSI_DEBUG
std
::
cout
<<
"[DEBUG] RequestProc::Execute()"
<<
std
::
endl
;
#endif
...
...
@@ -183,7 +185,13 @@ void RequestProc<RequestType, MetadataType, AlertType>::Execute()
// Wait for the framework to call Finished()
auto
finished
=
m_promise
.
get_future
();
finished
.
wait
();
// Is it possible that Finished() is never called? We should probably use wait_for() here and throw an exception if it times out
if
(
finished
.
wait_for
(
std
::
chrono
::
seconds
(
ExecuteTimeout
))
==
std
::
future_status
::
timeout
)
{
throw
XrdSsiException
(
"RequestProc::Finished() was never called!"
);
// Potentially could call Finished() with cancel == true here instead of throwing an exception?
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment