8000 Bug fix/fix context allocation (#4892) · Sandychuang/arangodb@5fbb78f · GitHub
[go: up one dir, main page]

Skip to content

Commit 5fbb78f

Browse files
dothebartjsteemann
authored andcommitted
Bug fix/fix context allocation (arangodb#4892)
1 parent 5c70062 commit 5fbb78f

File tree

2 files changed

+1
-27
lines changed

2 files changed

+1
-27
lines changed

arangod/V8Server/V8DealerFeature.cpp

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ V8Context* V8DealerFeature::addContext() {
322322

323323
// no other thread can use the context when we are here, as the
324324
// context has not been added to the global list of contexts yet
325-
loadJavaScriptFileInContextNoLock(database->systemDatabase(), "server/initialize.js", context);
325+
loadJavaScriptFileInContext(database->systemDatabase(), "server/initialize.js", context, nullptr);
326326
return context;
327327
} catch (...) {
328328
delete context;
@@ -1342,31 +1342,6 @@ bool V8DealerFeature::loadJavaScriptFileInContext(TRI_vocbase_t* vocbase,
13421342
return true;
13431343
}
13441344

1345-
bool V8DealerFeature::loadJavaScriptFileInContextNoLock(TRI_vocbase_t* vocbase,
1346-
std::string const& file, V8Context* context) {
1347-
TRI_ASSERT(vocbase != nullptr);
1348-
TRI_ASSERT(context != nullptr);
1349-
1350-
if (_stopping) {
1351-
return false;
1352-
}
1353-
1354-
if (!vocbase->use()) {
1355-
return false;
1356-
}
1357-
1358-
prepareLockedContext(vocbase, context, true);
1359-
1360-
try {
1361-
loadJavaScriptFileInternal(file, context, nullptr);
1362-
} catch (...) {
1363-
LOG_TOPIC(WARN, Logger::V8) << "caught exception while executing JavaScript file '" << file << "' in context #" << context->id();
1364-
throw;
1365-
}
1366-
1367-
return true;
1368-
}
1369-
13701345
void V8DealerFeature::loadJavaScriptFileInternal(std::string const& file, V8Context* context, VPackBuilder* builder) {
13711346
v8::HandleScope scope(context->_isolate);
13721347
auto localContext =

arangod/V8Server/V8DealerFeature.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ class V8DealerFeature final : public application_features::ApplicationFeature {
133133
void loadJavaScriptFileInternal(std::string const& file, V8Context* context,
134134
VPackBuilder* builder);
135135
bool loadJavaScriptFileInContext(TRI_vocbase_t*, std::string const& file, V8Context* context, VPackBuilder* builder);
136-
bool loadJavaScriptFileInContextNoLock(TRI_vocbase_t*, std::string const& file, V8Context* context);
137136
void prepareLockedContext(TRI_vocbase_t*, V8Context*, bool allowUseDatabase);
138137
void exitContextInternal(V8Context*);
139138
void cleanupLockedContext(V8Context*);

0 commit comments

Comments
 (0)
0