8000 remove unused variables from MaintenanceFeature (#11762) · thedemodev/arangodb@9730fba · GitHub
[go: up one dir, main page]

Skip to content

Commit 9730fba

Browse files
authored
remove unused variables from MaintenanceFeature (arangodb#11762)
1 parent e2745b2 commit 9730fba

File tree

2 files changed

+3
-21
lines changed

2 files changed

+3
-21
lines changed

arangod/Cluster/MaintenanceFeature.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ MaintenanceFeature::MaintenanceFeature(application_features::ApplicationServer&
6868
: ApplicationFeature(server, "Maintenance"),
6969
_forceActivation(false),
7070
_maintenanceThreadsMax(2),
71-
_resignLeadershipOnShutdown(false),
72-
_currentCounter(0) {
71+
_resignLeadershipOnShutdown(false) {
7372
// the number of threads will be adjusted later. it's just that we want to
7473
// initialize all members properly
7574

@@ -354,16 +353,6 @@ void MaintenanceFeature::beginShutdown() {
354353
} // MaintenanceFeature
355354

356355
void MaintenanceFeature::stop() {
357-
// There should be no new workers.
358-
// Current workers could be stuck on the condition variable.
359-
// Let's wake them up now.
360-
{
361-
// Only if we have flagged shutdown this operation is safe, all other threads potentially
362-
// trying to get this mutex get into the shutdown case now, instead of getting into wait state.
363-
TRI_ASSERT(_isShuttingDown);
364-
std::unique_lock<std::mutex> guard(_currentCounterLock);
365-
_currentCounterCondition.notify_all();
366-
}
367356
for (auto const& itWorker : _activeWorkers) {
368357
CONDITION_LOCKER(cLock, _workerCompletion);
369358

arangod/Cluster/MaintenanceFeature.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
#include "ProgramOptions/ProgramOptions.h"
3535
#include "RestServer/MetricsFeature.h"
3636

37+
#include <memory>
38+
#include <mutex>
3739
#include <queue>
3840

3941
namespace arangodb {
@@ -423,15 +425,6 @@ class MaintenanceFeature : public application_features::ApplicationFeature {
423425

424426
std::atomic<std::chrono::steady_clock::duration> _pauseUntil;
425427

426-
/// @brief Mutex for the current counter condition variable
427-
mutable std::mutex _currentCounterLock;
428-
429-
/// @brief Condition variable where Actions can wait on until _currentCounter increased
430-
std::condition_variable _currentCounterCondition;
431-
432-
/// @brief counter for load_current requests.
433-
uint64_t _currentCounter;
434-
435428
public:
436429
std::optional<std::reference_wrapper<Histogram<log_scale_t<uint64_t>>>> _phase1_runtime_msec;
437430
std::optional<std::reference_wrapper<Histogram<log_scale_t<uint64_t>>>> _phase2_runtime_msec;

0 commit comments

Comments
 (0)
0