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
d088c69f
Commit
d088c69f
authored
8 years ago
by
Eric Cano
Browse files
Options
Downloads
Patches
Plain Diff
Fixed timeout computation in SignalHandler::processEvent().
parent
ceeecfa3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tapeserver/daemon/SignalHandler.cpp
+8
-2
8 additions, 2 deletions
tapeserver/daemon/SignalHandler.cpp
with
8 additions
and
2 deletions
tapeserver/daemon/SignalHandler.cpp
+
8
−
2
View file @
d088c69f
...
...
@@ -107,7 +107,7 @@ SubprocessHandler::ProcessingStatus SignalHandler::processEvent() {
case
SIGINT
:
case
SIGTERM
:
// We will now require shutdown (if not already done)
// record the time to define timeout.
// record the time to define timeout.
After the timeout expires, we will require kill.
if
(
!
m_shutdownRequested
)
{
m_shutdownRequested
=
true
;
m_shutdownStartTime
=
std
::
chrono
::
steady_clock
::
now
();
...
...
@@ -127,7 +127,12 @@ SubprocessHandler::ProcessingStatus SignalHandler::processEvent() {
// If the shutdown was not acknowledged (by receiving it ourselves), we ask
// for it
ret
.
shutdownRequested
=
m_shutdownRequested
&&
!
m_shutdownAcknowlegded
;
ret
.
nextTimeout
=
m_shutdownStartTime
+
m_timeoutDuration
;
// Compute the timeout if shutdown was requested. Else, it is end of times.
if
(
m_shutdownRequested
)
{
ret
.
nextTimeout
=
m_shutdownStartTime
+
m_timeoutDuration
;
}
else
{
ret
.
nextTimeout
=
decltype
(
ret
.
nextTimeout
)
::
max
();
}
ret
.
sigChild
=
m_sigChildPending
;
ret
.
shutdownComplete
=
true
;
// We are always ready to leave.
return
ret
;
...
...
@@ -143,6 +148,7 @@ void SignalHandler::prepareForFork() {
SubprocessHandler
::
ProcessingStatus
SignalHandler
::
processTimeout
()
{
// If we reach timeout, it means it's time to kill child processes
m_processManager
.
logContext
().
log
(
log
::
INFO
,
"In signal handler, initiating subprocess kill after timeout on shutdown"
);
SubprocessHandler
::
ProcessingStatus
ret
;
ret
.
killRequested
=
true
;
ret
.
shutdownComplete
=
true
;
...
...
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