8000 Bug fix/daily fixes (#2958) · Hotkey/arangodb@ce2425c · GitHub
[go: up one dir, main page]

Skip to content

Commit ce2425c

Browse files
jsteemannfceller
authored andcommitted
Bug fix/daily fixes (arangodb#2958)
* do not rely on non-existing feature "AQL" using such feature makes the server throw two exceptions (which will be caught) on startup, but its silly for debugging * use condition variable for signalling shutdown * do not hard-code the log levels for recovery tests this has taken so many developers so much of their time that it is about time to fix it * ensure the 'unittests' script properly finds 'arangosh' and the build directory
1 parent bfa1051 commit ce2425c

File tree

5 files changed

+29
-10
lines changed

5 files changed

+29
-10
lines changed

arangod/RestServer/BootstrapFeature.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ BootstrapFeature::BootstrapFeature(
5050
startsAfter("CheckVersion");
5151
startsAfter("FoxxQueues");
5252
startsAfter("GeneralServer");
53-
startsAfter("AQL");
5453
}
5554

5655
void BootstrapFeature::collectOptions(std::shared_ptr<ProgramOptions> options) {

js/client/modules/@arangodb/testsuites/recovery.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,10 @@ function runArangodRecovery (instanceInfo, options, script, setup) {
6565

6666
if (setup) {
6767
argv = argv.concat([
68-
'--log.level', 'fatal',
6968
'--javascript.script-parameter', 'setup'
7069
]);
7170
} else {
7271
argv = argv.concat([
73-
'--log.level', 'info',
7472
'--wal.ignore-logfile-errors', 'true',
7573
'--javascript.script-parameter', 'recovery'
7674
]);

lib/ApplicationFeatures/ApplicationServer.cpp

Lines changed: 5 additions & 4 deletions
8000
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
#include "ApplicationFeatures/ApplicationFeature.h"
2626
#include "ApplicationFeatures/PrivilegeFeature.h"
27+
#include "Basics/ConditionLocker.h"
2728
#include "Basics/StringUtils.h"
2829
#include "Basics/process-utils.h"
2930
#include "Logger/Logger.h"
@@ -273,8 +274,8 @@ void ApplicationServer::beginShutdown() {
273274
}
274275
}
275276

276-
// TODO: use condition variable for signaling shutdown
277-
// to run method
277+
CONDITION_LOCKER(guard, _shutdownCondition);
278+
guard.signal();
278279
}
279280

280281
void ApplicationServer::shutdownFatalError() {
@@ -694,8 +695,8 @@ void ApplicationServer::wait() {
694695
LOG_TOPIC(TRACE, Logger::STARTUP) << "ApplicationServer::wait";
695696

696697
while (!_stopping) {
697-
// TODO: use condition variable for waiting for shutdown
698-
::usleep(100000);
698+
CONDITION_LOCKER(guard, _shutdownCondition);
699+
guard.wait(100000);
699700
}
700701
}
701702

lib/ApplicationFeatures/ApplicationServer.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#define ARANGODB_APPLICATION_FEATURES_APPLICATION_SERVER_H 1
2525

2626
#include "Basics/Common.h"
27+
#include "Basics/ConditionVariable.h"
2728

2829
#include <velocypack/Builder.h>
2930
#include <velocypack/velocypack-aliases.h>
@@ -300,6 +301,9 @@ class ApplicationServer {
300301

301302
// features order for prepare/start
302303
std::vector<ApplicationFeature*> _orderedFeatures;
304+
305+
// will be signalled when the application server is asked to shut down
306+
basics::ConditionVariable _shutdownCondition;
303307

304308
// stop flag. this is being changed by calling beginShutdown
305309
std::atomic<bool> _stopping;

scripts/unittest

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,33 @@ if [ -z "${ARANGOSH}" ]; then
2727
elif [ -x usr/bin/arangosh ]; then
2828
ARANGOSH=usr/bin/arangosh
2929
else
30-
echo "$0: cannot locate arangosh"
31-
exit 1
30+
ARANGOSH="$(find . -name arangosh -executable -type f | head -n 1)"
31+
[ -x "${ARANGOSH}" ] || {
32+
echo "$0: cannot locate arangosh"
33+
exit 1
34+
}
3235
fi
3336
fi
3437

38+
EXEC_PATH="$(dirname "$(dirname "$(readlink -m "$0")")")"
67E6 39+
declare -a EXTRA_ARGS
40+
41+
[ -x "${ARANGOSH}" ] && ARANGOSH="$(readlink -m "${ARANGOSH}")"
42+
43+
[[ " $@ " =~ "--build" ]] || {
44+
BUILD_PATH="$(dirname "$(dirname "${ARANGOSH}")")"
45+
BUILD_PATH="${BUILD_PATH#${EXEC_PATH}/}"
46+
EXTRA_ARGS=("--build" "${BUILD_PATH}")
47+
}
48+
3549
#
50+
(
51+
cd "${EXEC_PATH}"
3652
exec $NUMA $ARANGOSH \
3753
-c etc${PS}relative${PS}arangosh.conf \
3854
--log.level warning \
3955
--server.endpoint tcp://127.0.0.1:${PORT} \
4056
--javascript.execute UnitTests${PS}unittest.js \
4157
-- \
42-
"$@"
58+
"$@" "${EXTRA_ARGS[@]}"
59+
)

0 commit comments

Comments
 (0)
0