mirror of https://gitee.com/bigwinds/arangodb
improved debug facilities
This commit is contained in:
parent
8b7fe79ebb
commit
2b5cf28d74
|
@ -640,6 +640,8 @@ V8Context* V8DealerFeature::enterContext(TRI_vocbase_t* vocbase,
|
||||||
CONDITION_LOCKER(guard, _contextCondition);
|
CONDITION_LOCKER(guard, _contextCondition);
|
||||||
|
|
||||||
while (_freeContexts.empty() && !_stopping) {
|
while (_freeContexts.empty() && !_stopping) {
|
||||||
|
TRI_ASSERT(guard.isLocked());
|
||||||
|
|
||||||
LOG_TOPIC(TRACE, arangodb::Logger::V8) << "waiting for unused V8 context";
|
LOG_TOPIC(TRACE, arangodb::Logger::V8) << "waiting for unused V8 context";
|
||||||
|
|
||||||
if (!_dirtyContexts.empty()) {
|
if (!_dirtyContexts.empty()) {
|
||||||
|
@ -653,10 +655,11 @@ V8Context* V8DealerFeature::enterContext(TRI_vocbase_t* vocbase,
|
||||||
if (_contexts.size() + _nrInflightContexts < _nrMaxContexts) {
|
if (_contexts.size() + _nrInflightContexts < _nrMaxContexts) {
|
||||||
++_nrInflightContexts;
|
++_nrInflightContexts;
|
||||||
|
|
||||||
|
TRI_ASSERT(guard.isLocked());
|
||||||
guard.unlock();
|
guard.unlock();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
LOG_TOPIC(TRACE, Logger::V8) << "creating additional V8 context";
|
LOG_TOPIC(DEBUG, Logger::V8) << "creating additional V8 context";
|
||||||
context = addContext();
|
context = addContext();
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
guard.lock();
|
guard.lock();
|
||||||
|
@ -666,6 +669,7 @@ V8Context* V8DealerFeature::enterContext(TRI_vocbase_t* vocbase,
|
||||||
}
|
}
|
||||||
|
|
||||||
// must re-lock
|
// must re-lock
|
||||||
|
TRI_ASSERT(!guard.isLocked());
|
||||||
guard.lock();
|
guard.lock();
|
||||||
|
|
||||||
--_nrInflightContexts;
|
--_nrInflightContexts;
|
||||||
|
@ -674,6 +678,7 @@ V8Context* V8DealerFeature::enterContext(TRI_vocbase_t* vocbase,
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
// oops
|
// oops
|
||||||
delete context;
|
delete context;
|
||||||
|
context = nullptr;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -683,6 +688,7 @@ V8Context* V8DealerFeature::enterContext(TRI_vocbase_t* vocbase,
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
TRI_ASSERT(!_contexts.empty());
|
TRI_ASSERT(!_contexts.empty());
|
||||||
_contexts.pop_back();
|
_contexts.pop_back();
|
||||||
|
TRI_ASSERT(context != nullptr);
|
||||||
delete context;
|
delete context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -693,6 +699,7 @@ V8Context* V8DealerFeature::enterContext(TRI_vocbase_t* vocbase,
|
||||||
JobGuard jobGuard(SchedulerFeature::SCHEDULER);
|
JobGuard jobGuard(SchedulerFeature::SCHEDULER);
|
||||||
jobGuard.block();
|
jobGuard.block();
|
||||||
|
|
||||||
|
TRI_ASSERT(guard.isLocked());
|
||||||
guard.wait(100000);
|
guard.wait(100000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -701,6 +708,8 @@ V8Context* V8DealerFeature::enterContext(TRI_vocbase_t* vocbase,
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TRI_ASSERT(guard.isLocked());
|
||||||
|
|
||||||
// in case we are in the shutdown phase, do not enter a context!
|
// in case we are in the shutdown phase, do not enter a context!
|
||||||
// the context might have been deleted by the shutdown
|
// the context might have been deleted by the shutdown
|
||||||
|
|
Loading…
Reference in New Issue