8000 release version 3.4.8 · arangodb/arangodb@54c9f97 · GitHub
[go: up one dir, main page]

Skip to content

Commit 54c9f97

Browse files
kvahedKVS85
authored andcommitted
release version 3.4.8
* [3.4] fix agency lockup when removing 404-ed callbacks (#9839)
1 parent 8e37de4 commit 54c9f97

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

arangod/Agency/Agent.cpp

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@
3131

3232
#include "Agency/AgentCallback.h"
3333
#include "Agency/GossipCallback.h"
34+
#include "Agency/AgencyFeature.h"
3435
#include "Basics/ConditionLocker.h"
3536
#include "Basics/ReadLocker.h"
3637
#include "Basics/WriteLocker.h"
3738
#include "RestServer/QueryRegistryFeature.h"
3839
#include "RestServer/SystemDatabaseFeature.h"
40+
#include "Scheduler/SchedulerFeature.h"
3941
#include "VocBase/vocbase.h"
4042

4143
using namespace arangodb::application_features;
@@ -1960,10 +1962,19 @@ void Agent::emptyCbTrashBin() {
19601962
_callbackLastPurged = std::chrono::steady_clock::now();
19611963
}
19621964

1963-
LOG_TOPIC(DEBUG, Logger::AGENCY) << "unobserving: " << envelope->toJson();
1964-
1965-
// Best effort. Will be retried anyway
1966-
auto wres = write(envelope);
1965+
// Best effort. Will be retried otherwise.
1966+
LOG_TOPIC(DEBUG, Logger::AGENCY) << "scheduling unobserve: " << envelope->toJson();
1967+
auto* scheduler = SchedulerFeature::SCHEDULER;
1968+
1969+
if (scheduler != nullptr) {
1970+
scheduler->queue(
1971+
RequestPriority::LOW, [envelope](bool) {
1972+
auto* agent = AgencyFeature::AGENT;
1973+
if (!application_features::ApplicationServer::isStopping() && agent) {
1974+
agent->write(envelope);
1975+
}
1976+
});
1977+
}
19671978

19681979
}
19691980

0 commit comments

Comments
 (0)
0