1
0
Fork 0

Added a stop to Network feature. There is a race condition on the gar… (#9892)

* Added a stop to Network feature. There is a race condition on the garbage collection post

* Added cleanup for analyzer test and view test

* Update tests/js/client/shell/shell-analyzer-rest-api.js

Fixed usage of wrong command
This commit is contained in:
Michael Hackstein 2019-09-05 08:31:11 +02:00 committed by GitHub
parent 412e5280bc
commit 1b1763c496
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 57 additions and 36 deletions

View File

@ -149,4 +149,10 @@ void NetworkFeature::beginShutdown() {
}
}
void NetworkFeature::stop() {
// we might have posted another workItem during shutdown.
std::lock_guard<std::mutex> guard(_workItemMutex);
_workItem.reset();
}
} // namespace arangodb

View File

@ -43,6 +43,7 @@ class NetworkFeature final : public application_features::ApplicationFeature {
void prepare() override;
void start() override;
void beginShutdown() override;
void stop() override;
/// @brief global connection pool
static arangodb::network::ConnectionPool* pool() {
@ -56,7 +57,6 @@ class NetworkFeature final : public application_features::ApplicationFeature {
#endif
private:
uint32_t _numIOThreads;
uint64_t _maxOpenConnections;
uint64_t _connectionTtlMilli;

View File

@ -246,6 +246,7 @@ function testSuite() {
},
testAnalyzerLinks : function() {
try {
let body = JSON.stringify({
name : name,
type : "text",
@ -279,8 +280,14 @@ function testSuite() {
// delete with force - must succeed
result = arango.DELETE("/_api/analyzer/" + name + "?force=true");
assertFalse(result.error);
db._drop(col.name());
} finally {
try {
db._drop("ulfColTestLinks");
} catch (_) {}
try {
db._dropView("ulfViewTestLinks");
} catch (_) {}
}
}
}; // return
} // end of suite

View File

@ -43,6 +43,14 @@ var ERRORS = arangodb.errors;
function ViewSuite () {
'use strict';
return {
tearDown : function () {
try {
db._dropView("abc");
} catch (_) {}
try {
db._dropView("def");
} catch (_) {}
},
////////////////////////////////////////////////////////////////////////////
/// @brief bad name (empty)