1
0
Fork 0

All hail to the SI (#9445)

This commit is contained in:
Wilfried Goesgens 2019-07-19 13:52:12 +02:00 committed by Jan
parent cbcf561450
commit ca0f2b8b86
46 changed files with 82 additions and 82 deletions

View File

@ -1014,7 +1014,7 @@ uint64_t AgencyComm::uniqid(uint64_t count, double timeout) {
while (tries++ < maxTries) {
result = getValues("Sync/LatestID");
if (!result.successful()) {
std::this_thread::sleep_for(std::chrono::microseconds(500000));
std::this_thread::sleep_for(std::chrono::milliseconds(500));
continue;
}
@ -1050,7 +1050,7 @@ uint64_t AgencyComm::uniqid(uint64_t count, double timeout) {
try {
newBuilder.add(VPackValue(newValue));
} catch (...) {
std::this_thread::sleep_for(std::chrono::microseconds(500000));
std::this_thread::sleep_for(std::chrono::milliseconds(500));
continue;
}

View File

@ -326,7 +326,7 @@ void AgencyFeature::stop() {
if (_agent->inception() != nullptr) { // can only exist in resilient agents
int counter = 0;
while (_agent->inception()->isRunning()) {
std::this_thread::sleep_for(std::chrono::microseconds(100000));
std::this_thread::sleep_for(std::chrono::milliseconds(100));
// emit warning after 5 seconds
if (++counter == 10 * 5) {
LOG_TOPIC("bf6a6", WARN, Logger::AGENCY)
@ -338,7 +338,7 @@ void AgencyFeature::stop() {
if (_agent != nullptr) {
int counter = 0;
while (_agent->isRunning()) {
std::this_thread::sleep_for(std::chrono::microseconds(100000));
std::this_thread::sleep_for(std::chrono::milliseconds(100));
// emit warning after 5 seconds
if (++counter == 10 * 5) {
LOG_TOPIC("5d3a5", WARN, Logger::AGENCY) << "waiting for agent thread to finish";

View File

@ -112,7 +112,7 @@ void Agent::waitForThreadsStop() {
while (_constituent.isRunning() || _compactor.isRunning() ||
(_config.supervision() && _supervision.isRunning()) ||
(_inception != nullptr && _inception->isRunning())) {
std::this_thread::sleep_for(std::chrono::microseconds(100000));
std::this_thread::sleep_for(std::chrono::milliseconds(100));
// fail fatally after 5 mins:
if (++counter >= 10 * 60 * 5) {

View File

@ -408,7 +408,7 @@ void Inception::reportVersionForEp(std::string const& endpoint, size_t version)
void Inception::run() {
auto server = ServerState::instance();
while (server->isMaintenance() && !this->isStopping() && !_agent->isStopping()) {
std::this_thread::sleep_for(std::chrono::microseconds(1000000));
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
LOG_TOPIC("1b613", DEBUG, Logger::AGENCY)
<< "Waiting for RestHandlerFactory to exit maintenance mode before we "
" start gossip protocol...";

View File

@ -4046,7 +4046,7 @@ AqlValue Functions::Sleep(ExpressionContext* expressionContext,
double const until = TRI_microtime() + value.toDouble();
while (TRI_microtime() < until) {
std::this_thread::sleep_for(std::chrono::microseconds(30000));
std::this_thread::sleep_for(std::chrono::milliseconds(300));
if (expressionContext->killed()) {
THROW_ARANGO_EXCEPTION(TRI_ERROR_QUERY_KILLED);

View File

@ -449,7 +449,7 @@ void ClusterFeature::stop() {
if (_heartbeatThread != nullptr) {
int counter = 0;
while (_heartbeatThread->isRunning()) {
std::this_thread::sleep_for(std::chrono::microseconds(100000));
std::this_thread::sleep_for(std::chrono::milliseconds(100));
// emit warning after 5 seconds
if (++counter == 10 * 5) {
LOG_TOPIC("acaa9", WARN, arangodb::Logger::CLUSTER)
@ -480,7 +480,7 @@ void ClusterFeature::unprepare() {
if (_heartbeatThread != nullptr) {
int counter = 0;
while (_heartbeatThread->isRunning()) {
std::this_thread::sleep_for(std::chrono::microseconds(100000));
std::this_thread::sleep_for(std::chrono::milliseconds(100));
// emit warning after 5 seconds
if (++counter == 10 * 5) {
LOG_TOPIC("26835", WARN, arangodb::Logger::CLUSTER)
@ -514,7 +514,7 @@ void ClusterFeature::unprepare() {
comm.sendTransactionWithFailover(unreg, 120.0);
while (_heartbeatThread->isRunning()) {
std::this_thread::sleep_for(std::chrono::microseconds(50000));
std::this_thread::sleep_for(std::chrono::milliseconds(50));
}
AgencyCommManager::MANAGER->stop();
@ -544,7 +544,7 @@ void ClusterFeature::startHeartbeatThread(AgencyCallbackRegistry* agencyCallback
while (!_heartbeatThread->isReady()) {
// wait until heartbeat is ready
std::this_thread::sleep_for(std::chrono::microseconds(10000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
}

View File

@ -3771,7 +3771,7 @@ std::shared_ptr<std::vector<ServerID>> ClusterInfo::getResponsibleServer(ShardID
}
}
}
std::this_thread::sleep_for(std::chrono::microseconds(500000));
std::this_thread::sleep_for(std::chrono::milliseconds(500));
}
if (++tries >= 2) {

View File

@ -201,7 +201,7 @@ Result FollowerInfo::add(ServerID const& sid) {
<< "FollowerInfo::add, could not read " << planPath << " and "
<< curPath << " in agency.";
}
std::this_thread::sleep_for(std::chrono::microseconds(500000));
std::this_thread::sleep_for(std::chrono::milliseconds(500));
} while (TRI_microtime() < startTime + 3600 &&
!application_features::ApplicationServer::isStopping());
// This is important, give it 1h if needed. We really do not want to get
@ -341,7 +341,7 @@ Result FollowerInfo::remove(ServerID const& sid) {
<< "FollowerInfo::remove, could not read " << planPath << " and "
<< curPath << " in agency.";
}
std::this_thread::sleep_for(std::chrono::microseconds(500000));
std::this_thread::sleep_for(std::chrono::milliseconds(500));
} while (TRI_microtime() < startTime + 7200 &&
!application_features::ApplicationServer::isStopping());

View File

@ -243,7 +243,7 @@ void HeartbeatThread::run() {
// startup aborted
return;
}
std::this_thread::sleep_for(std::chrono::microseconds(100000));
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
}

View File

@ -165,7 +165,7 @@ void MaintenanceFeature::stop() {
// loop on each worker, retesting at 10ms just in case
while (itWorker->isRunning()) {
_workerCompletion.wait(std::chrono::microseconds(10000));
_workerCompletion.wait(std::chrono::milliseconds(10));
} // if
} // for

View File

@ -119,7 +119,7 @@ void MMFilesCleanupThread::run() {
locker.wait(cleanupInterval());
} else {
// prevent busy waiting
std::this_thread::sleep_for(std::chrono::microseconds(10000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
} catch (...) {

View File

@ -556,7 +556,7 @@ void MMFilesCollectorThread::clearQueuedOperations() {
break;
}
}
std::this_thread::sleep_for(std::chrono::microseconds(10000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
TRI_ASSERT(_operationsQueueInUse); // by us
@ -1042,7 +1042,7 @@ void MMFilesCollectorThread::queueOperations(arangodb::MMFilesWalLogfile* logfil
}
// wait outside the mutex for the flag to be cleared
std::this_thread::sleep_for(std::chrono::microseconds(10000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
if (maxNumPendingOperations > 0 && _numPendingOperations < maxNumPendingOperations &&

View File

@ -1098,7 +1098,7 @@ void MMFilesCompactorThread::run() {
if (numCompacted > 0) {
// no need to sleep long or go into wait state if we worked.
// maybe there's still work left
std::this_thread::sleep_for(std::chrono::microseconds(1000));
std::this_thread::sleep_for(std::chrono::milliseconds(1));
} else if (state != TRI_vocbase_t::State::SHUTDOWN_COMPACTOR &&
_vocbase.state() == TRI_vocbase_t::State::NORMAL) {
// only sleep while server is still running

View File

@ -192,14 +192,14 @@ Result MMFilesEngine::dropDatabase(TRI_vocbase_t& database) {
// queued operations, a service which it offers:
auto callback = [&database]() {
database.shutdown();
std::this_thread::sleep_for(std::chrono::microseconds(10000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
};
while (!MMFilesLogfileManager::instance()->executeWhileNothingQueued(callback)) {
LOG_TOPIC("86acb", TRACE, Logger::ENGINES)
<< "Trying to shutdown dropped database, waiting for phase in which "
<< "the collector thread does not have queued operations.";
std::this_thread::sleep_for(std::chrono::microseconds(500000));
std::this_thread::sleep_for(std::chrono::milliseconds(500));
}
// stop compactor thread
shutdownDatabase(database);
@ -888,7 +888,7 @@ void MMFilesEngine::waitUntilDeletion(TRI_voc_tick_t id, bool force, int& status
}
++iterations;
std::this_thread::sleep_for(std::chrono::microseconds(50000));
std::this_thread::sleep_for(std::chrono::milliseconds(50));
}
status = TRI_ERROR_NO_ERROR;
@ -2637,7 +2637,7 @@ int MMFilesEngine::stopCleanup(TRI_vocbase_t* vocbase) {
thread->signal();
while (thread->isRunning()) {
std::this_thread::sleep_for(std::chrono::microseconds(5000));
std::this_thread::sleep_for(std::chrono::milliseconds(5));
}
return TRI_ERROR_NO_ERROR;
@ -2719,7 +2719,7 @@ int MMFilesEngine::stopCompactor(TRI_vocbase_t* vocbase) {
thread->signal();
while (thread->isRunning()) {
std::this_thread::sleep_for(std::chrono::microseconds(5000));
std::this_thread::sleep_for(std::chrono::milliseconds(5));
}
return TRI_ERROR_NO_ERROR;

View File

@ -509,7 +509,7 @@ void MMFilesLogfileManager::unprepare() {
if (_allocatorThread != nullptr) {
LOG_TOPIC("17e47", TRACE, arangodb::Logger::ENGINES) << "stopping allocator thread";
while (_allocatorThread->isRunning()) {
std::this_thread::sleep_for(std::chrono::microseconds(10000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
delete _allocatorThread;
_allocatorThread = nullptr;
@ -531,7 +531,7 @@ void MMFilesLogfileManager::unprepare() {
if (_removerThread != nullptr) {
LOG_TOPIC("89e81", TRACE, arangodb::Logger::ENGINES) << "stopping remover thread";
while (_removerThread->isRunning()) {
std::this_thread::sleep_for(std::chrono::microseconds(10000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
delete _removerThread;
_removerThread = nullptr;
@ -546,7 +546,7 @@ void MMFilesLogfileManager::unprepare() {
_collectorThread->forceStop();
while (_collectorThread->isRunning()) {
locker.unlock();
std::this_thread::sleep_for(std::chrono::microseconds(10000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
locker.lock();
}
delete _collectorThread;
@ -558,7 +558,7 @@ void MMFilesLogfileManager::unprepare() {
LOG_TOPIC("f4f93", TRACE, arangodb::Logger::ENGINES)
<< "stopping synchronizer thread";
while (_synchronizerThread->isRunning()) {
std::this_thread::sleep_for(std::chrono::microseconds(10000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
delete _synchronizerThread;
_synchronizerThread = nullptr;
@ -839,7 +839,7 @@ int MMFilesLogfileManager::waitForCollectorQueue(TRI_voc_cid_t cid, double timeo
// sleep without holding the lock
locker.unlock();
std::this_thread::sleep_for(std::chrono::microseconds(10000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
if (TRI_microtime() > end) {
return TRI_ERROR_LOCKED;
@ -961,7 +961,7 @@ bool MMFilesLogfileManager::waitForSync(double maxWait) {
}
// not everything was committed yet. wait a bit
std::this_thread::sleep_for(std::chrono::microseconds(10000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
if (TRI_microtime() >= end) {
// time's up!
@ -1640,7 +1640,7 @@ MMFilesLogfileManagerState MMFilesLogfileManager::state() {
if (application_features::ApplicationServer::isStopping()) {
break;
}
std::this_thread::sleep_for(std::chrono::microseconds(10000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
TRI_ASSERT(arangodb::ServerState::instance()->isCoordinator() ||
state.lastCommittedTick > 0);
@ -1801,7 +1801,7 @@ int MMFilesLogfileManager::waitForCollector(MMFilesWalLogfile::IdType logfileId,
break;
}
std::this_thread::sleep_for(std::chrono::microseconds(20000));
std::this_thread::sleep_for(std::chrono::milliseconds(20));
// try again
}
@ -2122,7 +2122,7 @@ void MMFilesLogfileManager::stopMMFilesCollectorThread() {
}
}
std::this_thread::sleep_for(std::chrono::microseconds(50000));
std::this_thread::sleep_for(std::chrono::milliseconds(50));
}
_collectorThread->beginShutdown();

View File

@ -218,7 +218,7 @@ MMFilesWalSlotInfo MMFilesWalSlots::nextUnused(TRI_voc_tick_t databaseId,
return MMFilesWalSlotInfo(res);
}
std::this_thread::sleep_for(std::chrono::microseconds(10 * 1000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
// try again in next iteration
} else {
TRI_ASSERT(_logfile != nullptr);
@ -572,7 +572,7 @@ int MMFilesWalSlots::closeLogfile(MMFilesWalSlot::TickType& lastCommittedTick, b
return res;
}
std::this_thread::sleep_for(std::chrono::microseconds(10 * 1000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
// try again in next iteration
} else {
TRI_ASSERT(_logfile != nullptr);

View File

@ -146,7 +146,7 @@ void GraphStore<V, E>::loadShards(WorkerConfig* config,
}
// we can only load one vertex collection at a time
while (_runningThreads > 0) {
std::this_thread::sleep_for(std::chrono::microseconds(5000));
std::this_thread::sleep_for(std::chrono::milliseconds(5));
}
}

View File

@ -325,7 +325,7 @@ void PregelFeature::cleanupAll() {
for (auto it : ws) {
it.second.second->cancelGlobalStep(VPackSlice());
}
std::this_thread::sleep_for(std::chrono::microseconds(1000 * 100)); // 100ms to send out cancel calls
std::this_thread::sleep_for(std::chrono::milliseconds(100)); // 100ms to send out cancel calls
}
void PregelFeature::handleConductorRequest(std::string const& path, VPackSlice const& body,

View File

@ -178,7 +178,7 @@ void RecoveryManager::_renewPrimaryServer(ShardID const& shard) {
break;
}
}
std::this_thread::sleep_for(std::chrono::microseconds(100000)); // 100ms
std::this_thread::sleep_for(std::chrono::milliseconds(100));
tries++;
} while (tries < 3);
}

View File

@ -86,7 +86,7 @@ Worker<V, E, M>::Worker(TRI_vocbase_t& vocbase, Algorithm<V, E, M>* algo, VPackS
template <typename V, typename E, typename M>
Worker<V, E, M>::~Worker() {
_state = WorkerState::DONE;
std::this_thread::sleep_for(std::chrono::microseconds(50000)); // 50ms wait for threads to die
std::this_thread::sleep_for(std::chrono::milliseconds(50)); // wait for threads to die
delete _readCache;
delete _writeCache;
delete _writeCacheNextGSS;

View File

@ -259,7 +259,7 @@ void ReplicationApplier::doStart(std::function<void()>&& cb,
while (_state.isShuttingDown()) {
// another instance is still around
writeLocker.unlock();
std::this_thread::sleep_for(std::chrono::microseconds(50 * 1000));
std::this_thread::sleep_for(std::chrono::milliseconds(50));
writeLocker.lock();
}
@ -324,7 +324,7 @@ void ReplicationApplier::doStart(std::function<void()>&& cb,
}
while (!_thread->hasStarted()) {
std::this_thread::sleep_for(std::chrono::microseconds(20000));
std::this_thread::sleep_for(std::chrono::milliseconds(20));
}
TRI_ASSERT(!_state.isActive() && !_state.isShuttingDown());

View File

@ -264,7 +264,7 @@ Syncer::JobSynchronizer::~JobSynchronizer() {
// wait until all posted jobs have been completed/canceled
while (hasJobInFlight()) {
std::this_thread::sleep_for(std::chrono::microseconds(20000));
std::this_thread::sleep_for(std::chrono::milliseconds(20));
std::this_thread::yield();
}
}
@ -561,7 +561,7 @@ Result Syncer::applyCollectionDumpMarker(transaction::Methods& trx, LogicalColle
LOG_TOPIC("569c6", DEBUG, Logger::REPLICATION)
<< "got lock timeout while waiting for lock on collection '"
<< coll->name() << "', retrying...";
std::this_thread::sleep_for(std::chrono::microseconds(50000));
std::this_thread::sleep_for(std::chrono::milliseconds(50));
// retry
}
} else {

View File

@ -577,7 +577,7 @@ void RestReplicationHandler::handleCommandMakeSlave() {
applier->startReplication();
while (applier->isInitializing()) { // wait for initial sync
std::this_thread::sleep_for(std::chrono::microseconds(50000));
std::this_thread::sleep_for(std::chrono::milliseconds(50));
if (application_features::ApplicationServer::isStopping()) {
generateError(Result(TRI_ERROR_SHUTTING_DOWN));
return;

View File

@ -76,7 +76,7 @@ void ConsoleFeature::unprepare() {
int iterations = 0;
while (_consoleThread->isRunning() && ++iterations < 30) {
std::this_thread::sleep_for(std::chrono::microseconds(100 * 1000)); // spin while console is still needed
std::this_thread::sleep_for(std::chrono::milliseconds(100)); // sleep while console is still needed
}
std::cout << std::endl << TRI_BYE_MESSAGE << std::endl;

View File

@ -61,7 +61,7 @@ ConsoleThread::~ConsoleThread() { shutdown(); }
static char const* USER_ABORTED = "user aborted";
void ConsoleThread::run() {
std::this_thread::sleep_for(std::chrono::microseconds(100 * 1000));
std::this_thread::sleep_for(std::chrono::milliseconds(100));
bool v8Enabled = V8DealerFeature::DEALER && V8DealerFeature::DEALER->isEnabled();
if (!v8Enabled) {

View File

@ -490,7 +490,7 @@ void DatabaseFeature::unprepare() {
_databaseManager->beginShutdown();
while (_databaseManager->isRunning()) {
std::this_thread::sleep_for(std::chrono::microseconds(5000));
std::this_thread::sleep_for(std::chrono::milliseconds(5));
}
}

View File

@ -201,7 +201,7 @@ void FlushFeature::stop() {
}
if (thread != nullptr) {
while (thread->isRunning()) {
std::this_thread::sleep_for(std::chrono::microseconds(10000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
{

View File

@ -223,7 +223,7 @@ void ServerFeature::waitForHeartbeat() {
if (HeartbeatThread::hasRunOnce()) {
break;
}
std::this_thread::sleep_for(std::chrono::microseconds(100 * 1000));
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
}

View File

@ -734,7 +734,7 @@ void RocksDBEdgeIndex::warmupInternal(transaction::Methods* trx, rocksdb::Slice
while (cc->isBusy()) {
// We should wait here, the cache will reject
// any inserts anyways.
std::this_thread::sleep_for(std::chrono::microseconds(10000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
auto entry =

View File

@ -74,7 +74,7 @@ RocksDBReplicationManager::~RocksDBReplicationManager() {
<< "giving up waiting for unused contexts";
}
std::this_thread::sleep_for(std::chrono::microseconds(500000));
std::this_thread::sleep_for(std::chrono::milliseconds(500));
++tries;
}

View File

@ -157,7 +157,7 @@ void RequestStatistics::process(RequestStatistics* statistics) {
if (_freeList.push(statistics)) {
break;
}
std::this_thread::sleep_for(std::chrono::microseconds(10000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
if (tries > 1) {

View File

@ -84,9 +84,9 @@ class arangodb::StatisticsThread final : public Thread {
public:
void run() override {
uint64_t const MAX_SLEEP_TIME = 250 * 1000;
uint64_t const MAX_SLEEP_TIME = 250;
uint64_t sleepTime = 100 * 1000;
uint64_t sleepTime = 100;
int nothingHappened = 0;
while (!isStopping() && StatisticsFeature::enabled()) {
@ -96,22 +96,22 @@ class arangodb::StatisticsThread final : public Thread {
if (++nothingHappened == 10 * 30) {
// increase sleep time every 30 seconds
nothingHappened = 0;
sleepTime += 50 * 1000;
sleepTime += 50;
if (sleepTime > MAX_SLEEP_TIME) {
sleepTime = MAX_SLEEP_TIME;
}
}
std::this_thread::sleep_for(std::chrono::microseconds(sleepTime));
std::this_thread::sleep_for(std::chrono::milliseconds(sleepTime));
} else {
nothingHappened = 0;
if (count < 10) {
std::this_thread::sleep_for(std::chrono::microseconds(10 * 1000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
} else if (count < 100) {
std::this_thread::sleep_for(std::chrono::microseconds(1 * 1000));
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
}
}

View File

@ -1096,7 +1096,7 @@ void StatisticsWorker::run() {
// startup aborted
return;
}
std::this_thread::sleep_for(std::chrono::microseconds(100000));
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
try {

View File

@ -64,7 +64,7 @@ CollectionKeysRepository::~CollectionKeysRepository() {
<< "giving up waiting for unused keys";
}
std::this_thread::sleep_for(std::chrono::microseconds(500000));
std::this_thread::sleep_for(std::chrono::milliseconds(500));
++tries;
}

View File

@ -1267,7 +1267,7 @@ void V8DealerFeature::shutdownContexts() {
// wait until garbage collector thread is done
while (!_gcFinished) {
std::this_thread::sleep_for(std::chrono::microseconds(10000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
LOG_TOPIC("ea409", DEBUG, arangodb::Logger::V8)

View File

@ -239,7 +239,7 @@ arangodb::Result Databases::create(std::string const& dbName, VPackSlice const&
break;
}
// sleep
std::this_thread::sleep_for(std::chrono::microseconds(10000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
if (vocbase == nullptr) {

View File

@ -245,13 +245,13 @@ Task::Task(std::string const& id, std::string const& name, TRI_vocbase_t& vocbas
Task::~Task() {}
void Task::setOffset(double offset) {
_offset = std::chrono::microseconds(static_cast<long long>(offset * 1000000));
_offset = std::chrono::milliseconds(static_cast<long long>(offset * 1000));
_periodic.store(false);
}
void Task::setPeriod(double offset, double period) {
_offset = std::chrono::microseconds(static_cast<long long>(offset * 1000000));
_interval = std::chrono::microseconds(static_cast<long long>(period * 1000000));
_offset = std::chrono::milliseconds(static_cast<long long>(offset * 1000));
_interval = std::chrono::milliseconds(static_cast<long long>(period * 1000));
_periodic.store(true);
}

View File

@ -645,7 +645,7 @@ int TRI_vocbase_t::dropCollectionWorker(arangodb::LogicalCollection* collection,
// sleep for a while
std::this_thread::yield();
std::this_thread::sleep_for(std::chrono::microseconds(10000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
TRI_ASSERT(writeLocker.isLocked());
@ -1393,7 +1393,7 @@ arangodb::Result TRI_vocbase_t::renameCollection(TRI_voc_cid_t cid,
// sleep for a while
std::this_thread::yield();
std::this_thread::sleep_for(std::chrono::microseconds(10000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
TRI_ASSERT(writeLocker.isLocked());
@ -1643,7 +1643,7 @@ arangodb::Result TRI_vocbase_t::dropView(TRI_voc_cid_t cid, bool allowDropSystem
// sleep for a while
std::this_thread::yield();
std::this_thread::sleep_for(std::chrono::microseconds(10000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
TRI_ASSERT(writeLocker.isLocked());

View File

@ -228,7 +228,7 @@ void BenchFeature::start() {
// give all threads a chance to start so they will not miss the broadcast
while (getStartCounter() < (int)_concurreny) {
std::this_thread::sleep_for(std::chrono::microseconds(5000));
std::this_thread::sleep_for(std::chrono::milliseconds(5));
}
if (_delay) {
@ -264,7 +264,7 @@ void BenchFeature::start() {
nextReportValue += stepValue;
}
std::this_thread::sleep_for(std::chrono::microseconds(10000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
double time = TRI_microtime() - start;

View File

@ -58,7 +58,7 @@ AutoTuneThread::AutoTuneThread(ImportHelper& importHelper)
: Thread("AutoTuneThread"),
_importHelper(importHelper),
_nextSend(std::chrono::steady_clock::now()),
_pace(std::chrono::microseconds(1000000 / importHelper.getThreadCount())) {}
_pace(std::chrono::milliseconds(1000 / importHelper.getThreadCount())) {}
AutoTuneThread::~AutoTuneThread() { shutdown(); }

View File

@ -947,7 +947,7 @@ void ImportHelper::waitForSenders() {
if (numIdle == _senderThreads.size()) {
return;
}
std::this_thread::sleep_for(std::chrono::microseconds(10000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
}
} // namespace import

View File

@ -390,7 +390,7 @@ int DaemonFeature::waitForChildProcess(int pid) {
}
// sleep a while and retry
std::this_thread::sleep_for(std::chrono::microseconds(500 * 1000));
std::this_thread::sleep_for(std::chrono::milliseconds(500));
}
// enough time has elapsed... we now abort our loop

View File

@ -435,7 +435,7 @@ void Logger::shutdown() {
int tries = 0;
while (_loggingThread->hasMessages() && ++tries < 1000) {
_loggingThread->wakeup();
std::this_thread::sleep_for(std::chrono::microseconds(10000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
_loggingThread->beginShutdown();
_loggingThread.reset();

View File

@ -333,7 +333,7 @@ SimpleHttpResult* SimpleHttpClient::doRequest(
this->close(); // this sets the state to IN_CONNECT for a retry
LOG_TOPIC("e5154", DEBUG, arangodb::Logger::HTTPCLIENT) << _errorMessage;
std::this_thread::sleep_for(std::chrono::microseconds(5000));
std::this_thread::sleep_for(std::chrono::milliseconds(5));
break;
}

View File

@ -3838,7 +3838,7 @@ static void JS_Wait(v8::FunctionCallbackInfo<v8::Value> const& args) {
// wait without gc
double until = TRI_microtime() + n;
while (TRI_microtime() < until) {
std::this_thread::sleep_for(std::chrono::microseconds(1000));
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
TRI_V8_RETURN_UNDEFINED();
@ -5253,7 +5253,7 @@ bool TRI_RunGarbageCollectionV8(v8::Isolate* isolate, double availableTime) {
}
}
std::this_thread::sleep_for(std::chrono::microseconds(1000));
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
return true;

View File

@ -70,9 +70,9 @@ TEST(CacheRebalancerTest, test_rebalancing_with_plaincache_LongRunning) {
while (!doneRebalancing) {
int status = rebalancer.rebalance();
if (status != TRI_ERROR_ARANGO_BUSY) {
std::this_thread::sleep_for(std::chrono::microseconds(500 * 1000));
std::this_thread::sleep_for(std::chrono::milliseconds(500));
} else {
std::this_thread::sleep_for(std::chrono::microseconds(10 * 1000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
}
};
@ -194,9 +194,9 @@ TEST(CacheRebalancerTest, test_rebalancing_with_transactionalcache_LongRunning)
while (!doneRebalancing) {
int status = rebalancer.rebalance();
if (status != TRI_ERROR_ARANGO_BUSY) {
std::this_thread::sleep_for(std::chrono::microseconds(500 * 1000));
std::this_thread::sleep_for(std::chrono::milliseconds(500));
} else {
std::this_thread::sleep_for(std::chrono::microseconds(10 * 1000));
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
}
};