Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
opendht
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Model registry
Analyze
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
savoirfairelinux
opendht
Commits
c8a0b443
Commit
c8a0b443
authored
3 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
dhtrunner: force execution of pending ops on shutdown
parent
00e595d7
Branches
Branches containing commit
Tags
2.2.1rc1
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/dhtrunner.cpp
+11
-2
11 additions, 2 deletions
src/dhtrunner.cpp
with
11 additions
and
2 deletions
src/dhtrunner.cpp
+
11
−
2
View file @
c8a0b443
...
...
@@ -294,6 +294,11 @@ DhtRunner::shutdown(ShutdownCallback cb, bool stop) {
if
(
dht_
)
dht_
->
shutdown
(
onShutdown
,
stop
);
});
// Force execution of pending ops
if
(
getStatus
()
==
NodeStatus
::
Connecting
)
{
status4
=
NodeStatus
::
Disconnected
;
status6
=
NodeStatus
::
Disconnected
;
}
cv
.
notify_all
();
}
...
...
@@ -368,6 +373,7 @@ DhtRunner::join()
{
std
::
lock_guard
<
std
::
mutex
>
lck
(
dht_mtx
);
resetDht
();
std
::
lock_guard
<
std
::
mutex
>
lck2
(
storage_mtx
);
status4
=
NodeStatus
::
Disconnected
;
status6
=
NodeStatus
::
Disconnected
;
}
...
...
@@ -703,8 +709,11 @@ DhtRunner::loop_()
NodeStatus
nstatus4
=
dht
->
updateStatus
(
AF_INET
);
NodeStatus
nstatus6
=
dht
->
updateStatus
(
AF_INET6
);
if
(
nstatus4
!=
status4
||
nstatus6
!=
status6
)
{
status4
=
nstatus4
;
status6
=
nstatus6
;
{
std
::
lock_guard
<
std
::
mutex
>
lck
(
storage_mtx
);
status4
=
nstatus4
;
status6
=
nstatus6
;
}
if
(
statusCb
)
statusCb
(
status4
,
status6
);
}
...
...
This diff is collapsed.
Click to expand it.
Adrien Béraud
@aberaud
mentioned in commit
d9ff95da
·
2 years ago
mentioned in commit
d9ff95da
mentioned in commit d9ff95da4967d5db8b0134bce43e7afc6d5c0cc4
Toggle commit list
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