8000 Fix shutdown hang (#16274) · arangodb/arangodb@c578ba7 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c578ba7

Browse files
jsteemannKVS85
andauthored
Fix shutdown hang (#16274)
* Fixed a potential hang on shutdown, when there were still document operations queued. Co-authored-by: Vadim <vadim@arangodb.com>
1 parent c256127 commit c578ba7
Copy full SHA for c578ba7

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
v3.8.7 (XXXX-XX-XX)
22
-------------------
33

4+
* Fixed a potential hang on shutdown, when there were still document operations
5+
queued.
6+
47
* No good reason to fatal error in agency state, when local database entries
58
lack local timestamp (legacy). In that situation, we will record epoch begin
69
as local time.

arangod/VocBase/vocbase.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,9 +1737,16 @@ std::vector<std::shared_ptr<arangodb::LogicalView>> TRI_vocbase_t::views() {
17371737
}
17381738

17391739
void TRI_vocbase_t::processCollectionsOnShutdown(std::function<void(LogicalCollection*)> const& cb) {
1740-
RECURSIVE_WRITE_LOCKER(_dataSourceLock, _dataSourceLockWriteOwner);
1740+
std::vector<std::shared_ptr<arangodb::LogicalCollection>> collections;
1741+
1742+
// make a copy of _collections, so we can call the callback function without
1743+
// the lock
1744+
{
1745+
RECURSIVE_READ_LOCKER(_dataSourceLock, _dataSourceLockWriteOwner);
1746+
collections = _collections;
1747+
}
17411748

1742-
for (auto const& it : _collections) {
1749+
for (auto const& it : collections) {
17431750
cb(it.get());
17441751
}
17451752
}

0 commit comments

Comments
 (0)
0