diff --git a/.gitignore b/.gitignore index bdfe54ab3d..26aaac25a1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,8 @@ *~ +3rdParty/czmq-1.1.0/libtool +3rdParty/czmq-1.1.0/src/czmq_selftest +3rdParty/czmq-1.1.0/src/libczmq.pc +3rdParty/czmq-1.1.0/src/platform.h 3rdParty/libev/ARCH.x64 3rdParty/libev/libtool 3rdParty/mruby/bin/mrbc @@ -11,9 +15,61 @@ 3rdParty/mruby/mrblib/mrblib.c 3rdParty/mruby/mrblib/mrblib.ctmp 3rdParty/mruby/mrblib/mrblib.rbtmp +3rdParty/protobuf-2.4.1/BUILD/ +3rdParty/protobuf-2.4.1/gtest/libtool +3rdParty/protobuf-2.4.1/gtest/scripts/gtest-config +3rdParty/protobuf-2.4.1/libtool +3rdParty/protobuf-2.4.1/protobuf-lite.pc +3rdParty/protobuf-2.4.1/protobuf.pc +3rdParty/protobuf-2.4.1/src/google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc +3rdParty/protobuf-2.4.1/src/google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.h +3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_custom_options.pb.cc +3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_custom_options.pb.h +3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_embed_optimize_for.pb.cc +3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_embed_optimize_for.pb.h +3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_empty.pb.cc +3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_empty.pb.h +3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_import_lite.pb.cc +3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_import_lite.pb.h +3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_import.pb.cc +3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_import.pb.h +3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_lite_imports_nonlite.pb.cc +3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_lite_imports_nonlite.pb.h +3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_lite.pb.cc +3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_lite.pb.h +3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_mset.pb.cc +3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_mset.pb.h +3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_no_generic_services.pb.cc +3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_no_generic_services.pb.h +3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_optimize_for.pb.cc +3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_optimize_for.pb.h +3rdParty/protobuf-2.4.1/src/google/protobuf/unittest.pb.cc +3rdParty/protobuf-2.4.1/src/google/protobuf/unittest.pb.h +3rdParty/protobuf-2.4.1/src/protoc +3rdParty/protobuf-2.4.1/src/unittest_proto_middleman 3rdParty/ptmalloc3/tst-independent-alloc 3rdParty/ptmalloc3/t-test1 3rdParty/ptmalloc3/t-test2 +3rdParty/zeromq-2.2.0/BUILD/ +3rdParty/zeromq-2.2.0/builds/redhat/zeromq.spec +3rdParty/zeromq-2.2.0/libtool +3rdParty/zeromq-2.2.0/perf/inproc_lat +3rdParty/zeromq-2.2.0/perf/inproc_thr +3rdParty/zeromq-2.2.0/perf/local_lat +3rdParty/zeromq-2.2.0/perf/local_thr +3rdParty/zeromq-2.2.0/perf/remote_lat +3rdParty/zeromq-2.2.0/perf/remote_thr +3rdParty/zeromq-2.2.0/src/libzmq.pc +3rdParty/zeromq-2.2.0/src/platform.hpp +3rdParty/zeromq-2.2.0/tests/test_hwm +3rdParty/zeromq-2.2.0/tests/test_pair_inproc +3rdParty/zeromq-2.2.0/tests/test_pair_ipc +3rdParty/zeromq-2.2.0/tests/test_pair_tcp +3rdParty/zeromq-2.2.0/tests/test_reqrep_inproc +3rdParty/zeromq-2.2.0/tests/test_reqrep_ipc +3rdParty/zeromq-2.2.0/tests/test_reqrep_tcp +3rdParty/zeromq-2.2.0/tests/test_shutdown_stress +3rdParty/zeromq-2.2.0/tests/test_timeo arangod/Ahuacatl/ahuacatl-grammar.output ARCH.* autom4te.cache @@ -29,14 +85,17 @@ config.h config.log config/revision.sh config.status +configure config/version.sh COVERAGE +.czmq-build-64 .deps .dirstamp Doxygen/arango.doxy Doxygen/html/ Doxygen/js Doxygen/latex/ +Doxygen/manuals Doxygen/.setup-directories Doxygen/web/*.html Doxygen/wiki/ @@ -47,14 +106,15 @@ Doxygen/xml/ GPATH GRTAGS GTAGS -lib/JsonParserX/JsonParserX.output +Installation/arangod.conf *.la lib*.a lib/BasicsC/local-configuration.h +lib/Documentation/*.pdf .libev-build-* +lib/JsonParserX/JsonParserX.output .libs *.lo -configure m4/component.engine m4/component.files m4/component.storage @@ -80,6 +140,7 @@ Makefile.local *.old out *.Po +.protobuf-build-64 *.pyc .setup-js-directories .setup-mr-directories @@ -90,6 +151,7 @@ tags TAGS UnitTests/basics_suite UnitTests/geo_suite +UnitTests/HttpInterface/Gemfile.lock UnitTests/HttpInterface/logs UnitTests/Jutland/CsvReaderTest.cpp UnitTests/Jutland/Makefile.am @@ -100,65 +162,4 @@ UnitTests/Philadelphia/Makefile.py UnitTests/Philadelphia/Runner.cpp .v8-build-* VC++ -3rdParty/protobuf-2.4.1/gtest/libtool -3rdParty/protobuf-2.4.1/gtest/scripts/gtest-config -3rdParty/protobuf-2.4.1/libtool -3rdParty/protobuf-2.4.1/protobuf-lite.pc -3rdParty/protobuf-2.4.1/protobuf.pc -3rdParty/protobuf-2.4.1/src/google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc -3rdParty/protobuf-2.4.1/src/google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.h -3rdParty/protobuf-2.4.1/src/google/protobuf/unittest.pb.cc -3rdParty/protobuf-2.4.1/src/google/protobuf/unittest.pb.h -3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_custom_options.pb.cc -3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_custom_options.pb.h -3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_embed_optimize_for.pb.cc -3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_embed_optimize_for.pb.h -3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_empty.pb.cc -3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_empty.pb.h -3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_import.pb.cc -3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_import.pb.h -3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_import_lite.pb.cc -3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_import_lite.pb.h -3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_lite.pb.cc -3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_lite.pb.h -3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_lite_imports_nonlite.pb.cc -3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_lite_imports_nonlite.pb.h -3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_mset.pb.cc -3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_mset.pb.h -3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_no_generic_services.pb.cc -3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_no_generic_services.pb.h -3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_optimize_for.pb.cc -3rdParty/protobuf-2.4.1/src/google/protobuf/unittest_optimize_for.pb.h -3rdParty/protobuf-2.4.1/src/protoc -3rdParty/protobuf-2.4.1/src/unittest_proto_middleman -3rdParty/zeromq-2.2.0/builds/redhat/zeromq.spec -3rdParty/zeromq-2.2.0/libtool -3rdParty/zeromq-2.2.0/perf/inproc_lat -3rdParty/zeromq-2.2.0/perf/inproc_thr -3rdParty/zeromq-2.2.0/perf/local_lat -3rdParty/zeromq-2.2.0/perf/local_thr -3rdParty/zeromq-2.2.0/perf/remote_lat -3rdParty/zeromq-2.2.0/perf/remote_thr -3rdParty/zeromq-2.2.0/src/libzmq.pc -3rdParty/zeromq-2.2.0/src/platform.hpp -3rdParty/zeromq-2.2.0/tests/test_hwm -3rdParty/zeromq-2.2.0/tests/test_pair_inproc -3rdParty/zeromq-2.2.0/tests/test_pair_ipc -3rdParty/zeromq-2.2.0/tests/test_pair_tcp -3rdParty/zeromq-2.2.0/tests/test_reqrep_inproc -3rdParty/zeromq-2.2.0/tests/test_reqrep_ipc -3rdParty/zeromq-2.2.0/tests/test_reqrep_tcp -3rdParty/zeromq-2.2.0/tests/test_shutdown_stress -3rdParty/zeromq-2.2.0/tests/test_timeo .zeromq-build-64 -3rdParty/zeromq-2.2.0/BUILD/ -.czmq-build-64 -3rdParty/czmq-1.1.0/libtool -3rdParty/czmq-1.1.0/src/czmq_selftest -3rdParty/czmq-1.1.0/src/libczmq.pc -3rdParty/czmq-1.1.0/src/platform.h -.protobuf-build-64 -3rdParty/protobuf-2.4.1/BUILD/ -Installation/arangod.conf -lib/Documentation/*.pdf -Doxygen/manuals diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..c92d145e15 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,9 @@ +language: c +before_script: "bash -c 'cd UnitTests/HttpInterface && bundle'" +script: "./configure && make && ./unittests.sh" + +branches: + only: + - master + - 1.0 + - 1.1 diff --git a/Doxygen/arango-html.doxy b/Doxygen/arango-html.doxy index c0edc689e8..729e25d321 100644 --- a/Doxygen/arango-html.doxy +++ b/Doxygen/arango-html.doxy @@ -31,7 +31,7 @@ PROJECT_NAME = "ArangoDB" # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 1.0.beta1 +PROJECT_NUMBER = 1.0.beta2 # Using the PROJECT_BRIEF tag one can provide an optional one line description for a project that appears at the top of each page and should give viewer a quick idea about the purpose of the project. Keep the description short. @@ -212,7 +212,7 @@ ALIASES += GE{1}="\1" ALIASES += EXAMPLES="Examples
" ALIASES += EXAMPLE{2}="@latexonly\renewcommand{\examplecap}{\2}\setboolean{hascap}{true}@endlatexonly@verbinclude \1@latexonly\setboolean{hascap}{false}@endlatexonly" ALIASES += TINYEXAMPLE{2}="@latexonly\renewcommand{\examplecap}{\2}\setboolean{hascap}{true}\renewcommand{\examplesize}{\tiny}@endlatexonly@verbinclude \1@latexonly\setboolean{hascap}{false}\renewcommand{\examplesize}{\ttfamily}@endlatexonly" -ALIASES += VERSION="1.0.beta1" +ALIASES += VERSION="1.0.beta2" ALIASES += EMBEDTOC{1}="@ifnot LATEX
@copydoc \1
@endif" ALIASES += RESTHEADER{2}="@if LATEX@latexonly \vskip 0.5em\colorbox{gray}{@endlatexonly\1 (\2)@latexonly}\vskip 1em@endlatexonly@else
\1 (\2)

@endif" ALIASES += LATEXBREAK="@latexonly\vskip -0.5em\hskip 1.0em@endlatexonly" diff --git a/Doxygen/arango-latex.doxy b/Doxygen/arango-latex.doxy index 4d529bc90a..af9690a9d1 100644 --- a/Doxygen/arango-latex.doxy +++ b/Doxygen/arango-latex.doxy @@ -31,7 +31,7 @@ PROJECT_NAME = "ArangoDB" # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 1.0.beta1 +PROJECT_NUMBER = 1.0.beta2 # Using the PROJECT_BRIEF tag one can provide an optional one line description for a project that appears at the top of each page and should give viewer a quick idea about the purpose of the project. Keep the description short. @@ -212,7 +212,7 @@ ALIASES += GE{1}="\1" ALIASES += EXAMPLES="Examples
" ALIASES += EXAMPLE{2}="@latexonly\renewcommand{\examplecap}{\2}\setboolean{hascap}{true}@endlatexonly@verbinclude \1@latexonly\setboolean{hascap}{false}@endlatexonly" ALIASES += TINYEXAMPLE{2}="@latexonly\renewcommand{\examplecap}{\2}\setboolean{hascap}{true}\renewcommand{\examplesize}{\tiny}@endlatexonly@verbinclude \1@latexonly\setboolean{hascap}{false}\renewcommand{\examplesize}{\ttfamily}@endlatexonly" -ALIASES += VERSION="1.0.beta1" +ALIASES += VERSION="1.0.beta2" ALIASES += EMBEDTOC{1}="@ifnot LATEX
@copydoc \1
@endif" ALIASES += RESTHEADER{2}="@if LATEX@latexonly \vskip 0.5em\colorbox{gray}{@endlatexonly\1 (\2)@latexonly}\vskip 1em@endlatexonly@else
\1 (\2)

@endif" ALIASES += LATEXBREAK="@latexonly\vskip -0.5em\hskip 1.0em@endlatexonly" diff --git a/Doxygen/arango-xml.doxy b/Doxygen/arango-xml.doxy index 64b8e8a170..9d798e2a44 100644 --- a/Doxygen/arango-xml.doxy +++ b/Doxygen/arango-xml.doxy @@ -31,7 +31,7 @@ PROJECT_NAME = "ArangoDB" # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 1.0.beta1 +PROJECT_NUMBER = 1.0.beta2 # Using the PROJECT_BRIEF tag one can provide an optional one line description for a project that appears at the top of each page and should give viewer a quick idea about the purpose of the project. Keep the description short. @@ -212,7 +212,7 @@ ALIASES += GE{1}="\1" ALIASES += EXAMPLES="Examples
" ALIASES += EXAMPLE{2}="@latexonly\renewcommand{\examplecap}{\2}\setboolean{hascap}{true}@endlatexonly@verbinclude \1@latexonly\setboolean{hascap}{false}@endlatexonly" ALIASES += TINYEXAMPLE{2}="@latexonly\renewcommand{\examplecap}{\2}\setboolean{hascap}{true}\renewcommand{\examplesize}{\tiny}@endlatexonly@verbinclude \1@latexonly\setboolean{hascap}{false}\renewcommand{\examplesize}{\ttfamily}@endlatexonly" -ALIASES += VERSION="1.0.beta1" +ALIASES += VERSION="1.0.beta2" ALIASES += EMBEDTOC{1}="@ifnot LATEX
@copydoc \1
@endif" ALIASES += RESTHEADER{2}="@if LATEX@latexonly \vskip 0.5em\colorbox{gray}{@endlatexonly\1 (\2)@latexonly}\vskip 1em@endlatexonly@else
\1 (\2)

@endif" ALIASES += LATEXBREAK="@latexonly\vskip -0.5em\hskip 1.0em@endlatexonly" diff --git a/Doxygen/arango.template b/Doxygen/arango.template index 34f34f0f5a..5937354925 100644 --- a/Doxygen/arango.template +++ b/Doxygen/arango.template @@ -31,7 +31,7 @@ PROJECT_NAME = "ArangoDB" # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 1.0.beta1 +PROJECT_NUMBER = 1.0.beta2 # Using the PROJECT_BRIEF tag one can provide an optional one line description for a project that appears at the top of each page and should give viewer a quick idea about the purpose of the project. Keep the description short. @@ -212,7 +212,7 @@ ALIASES += GE{1}="\1" ALIASES += EXAMPLES="Examples
" ALIASES += EXAMPLE{2}="@latexonly\renewcommand{\examplecap}{\2}\setboolean{hascap}{true}@endlatexonly@verbinclude \1@latexonly\setboolean{hascap}{false}@endlatexonly" ALIASES += TINYEXAMPLE{2}="@latexonly\renewcommand{\examplecap}{\2}\setboolean{hascap}{true}\renewcommand{\examplesize}{\tiny}@endlatexonly@verbinclude \1@latexonly\setboolean{hascap}{false}\renewcommand{\examplesize}{\ttfamily}@endlatexonly" -ALIASES += VERSION="1.0.beta1" +ALIASES += VERSION="1.0.beta2" ALIASES += EMBEDTOC{1}="@ifnot LATEX
@copydoc \1
@endif" ALIASES += RESTHEADER{2}="@if LATEX@latexonly \vskip 0.5em\colorbox{gray}{@endlatexonly\1 (\2)@latexonly}\vskip 1em@endlatexonly@else
\1 (\2)

@endif" ALIASES += LATEXBREAK="@latexonly\vskip -0.5em\hskip 1.0em@endlatexonly" diff --git a/Installation/arangodb.list b/Installation/arangodb.list index 56bc335ac5..0f1356a0eb 100644 --- a/Installation/arangodb.list +++ b/Installation/arangodb.list @@ -39,8 +39,9 @@ d 0755 ${susr} ${sgrp} ${data_dir}/arangodb - # static files d 0755 ${susr} ${sgrp} ${static_dir} - -d 0755 ${susr} ${sgrp} ${static_dir}/js - -d 0755 ${susr} ${sgrp} ${static_dir}/html - +d 0755 ${susr} ${sgrp} ${static_dir}/arangodb - +d 0755 ${susr} ${sgrp} ${static_dir}/arangodb/js - +d 0755 ${susr} ${sgrp} ${static_dir}/arangodb/html - # PID file directory d 0755 ${susr} ${sgrp} /var/run/arangodb - @@ -80,7 +81,7 @@ EOF %else %preinstall </dev/null || groupadd -r arango -getent passwd arango >/dev/null || useradd -r -g arango -d ${static_dir} -s /bin/false -c "ArangoDB Application User" arango +getent passwd arango >/dev/null || useradd -r -g arango -d ${static_dir}/arangodb -s /bin/false -c "ArangoDB Application User" arango EOF %endif @@ -93,13 +94,37 @@ f 0755 ${rusr} ${rgrp} ${initdir}/arangod ${project_dir}/Installation/${START_SC %postinstall <1 > /dev/null || true chkconfig --del arangod -rcarangod stop || true +exit 0 EOF +## ----------------------------------------------------------------------------- +## INSSERV +## ----------------------------------------------------------------------------- + +%elseifdef insserv +f 0755 ${rusr} ${rgrp} ${initdir}/arangod ${project_dir}/Installation/${START_SCRIPT} + +%postinstall <1 > /dev/null +exit 0 +EOF + +%preremove <1 > /dev/null || true +test -x /sbin/insserv && /sbin/insserv -r /etc/init.d/arangod 2&>1 > /dev/null +exit 0 +EOF + +## ----------------------------------------------------------------------------- +## EPM +## ----------------------------------------------------------------------------- + %else %system linux diff --git a/Installation/rc.arangodb.OpenSuSE b/Installation/rc.arangodb.OpenSuSE index 07d285b8ef..84ff0c8afe 100644 --- a/Installation/rc.arangodb.OpenSuSE +++ b/Installation/rc.arangodb.OpenSuSE @@ -3,11 +3,11 @@ # # Author: Achim Brandt # -# /etc/init.d/arango +# /etc/init.d/arangod # # and symbolic its link # -# /usr/sbin/rcarango +# /usr/sbin/rcarangod # ### BEGIN INIT INFO # Provides: arangod @@ -25,6 +25,7 @@ ARANGO_SYSCONFIG=/etc/arangodb/arangod.conf test -r $ARANGO_SYSCONFIG || exit 6 +ARANGO_TIMEOUT=120 ARANGO_PIDFILE=/var/run/arangodb/arangod.pid . /etc/rc.status @@ -65,7 +66,7 @@ case "$1" in stop) echo -n "Shutting down ARANGO daemon" - killproc -p $ARANGO_PIDFILE -TERM $ARANGO_BIN + killproc -t $ARANGO_TIMEOUT -p $ARANGO_PIDFILE -TERM $ARANGO_BIN # Remember status and be verbose rc_status -v diff --git a/Makefile.in b/Makefile.in index 34d70643d1..0bba8e7b38 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1158,10 +1158,6 @@ AM_LDFLAGS = @BOOST_LDFLAGS@ @LIBEV_LDFLAGS@ @MATH_LDFLAGS@ \ noinst_LIBRARIES = lib/libarango.a lib/libarango_v8.a \ lib/libarango_fe.a lib/libarango_client.a $(am__append_8) -# exclude arango-password and arango-dfdb from sources list, otherwise make TAGS will fail -bin_arango_password_SOURCES = -bin_arango_dfdb_SOURCES = - ################################################################################ ### @brief /etc data ################################################################################ @@ -1589,11 +1585,8 @@ PIDFILE := /tmp/arango.$(PID).pid VOCDIR := /tmp/vocdir.$(PID) VOCPORT := $(shell printf "3%04d" `expr $(PID) % 10000`) VOCHOST := 127.0.0.1 -SERVER_OPT := --configuration none --javascript.startup-directory ./js \ - --javascript.modules-path \ - ./js/server/modules:./js/common/modules \ - --javascript.action-directory ./js/actions/system $(shell echo \ - $$SERVER_OPT) +SERVER_START := +SERVER_OPT := --configuration none --javascript.startup-directory ./js --javascript.modules-path ./js/server/modules:./js/common/modules --javascript.action-directory ./js/actions/system --database.maximal-journal-size 1000000 --javascript.gc-interval 1 $(SERVER_START) CLIENT_OPT := --javascript.startup-directory ./js --javascript.modules-path ./js/client/modules:./js/common/modules --no-colors --quiet STARTFILE := $(VOCDIR)/startup CURL := curl @@ -1658,6 +1651,7 @@ SHELL_SERVER_AHUACATL = @srcdir@/js/server/tests/ahuacatl-ranges.js \ @srcdir@/js/server/tests/ahuacatl-skiplist.js \ @srcdir@/js/server/tests/ahuacatl-refaccess-variable.js \ @srcdir@/js/server/tests/ahuacatl-refaccess-attribute.js \ + @srcdir@/js/server/tests/ahuacatl-skiplist.js \ @srcdir@/js/server/tests/ahuacatl-queries-simple.js \ @srcdir@/js/server/tests/ahuacatl-queries-variables.js \ @srcdir@/js/server/tests/ahuacatl-queries-geo.js \ @@ -1695,6 +1689,20 @@ UNITTESTS_CLIENT = $(addprefix --javascript.unit-tests ,$(SHELL_CLIENT)) ################################################################################ BITARRAY_COMMON = @srcdir@/js/common/tests/shell-bitarray-index.js UNITTESTS_SERVER_BITARRAY = $(addprefix --javascript.unit-tests ,$(BITARRAY_COMMON)) + +################################################################################ +### @brief arango password +################################################################################ + +# exclude arango skrips from sources list +bin_arango_password_SOURCES = + +################################################################################ +### @brief arango datafile debugger +################################################################################ + +# exclude arango skrips from sources list +bin_arango_dfdb_SOURCES = PROTOBUFDIR = @abs_top_srcdir@/3rdParty/protobuf-2.4.1/BUILD @ENABLE_32BIT_TRUE@@ENABLE_ALL_IN_ONE_TRUE@LIBEV_BUILD_VERSION = ARCH.ia32 @ENABLE_64BIT_TRUE@@ENABLE_ALL_IN_ONE_TRUE@LIBEV_BUILD_VERSION = ARCH.x64 @@ -5263,6 +5271,8 @@ start-server: @(test "$(PROTO)" == "unix" && echo "<< STARTING SERVER ON UNIX SOCKET ENDPOINT >>") || true @echo "================================================================================" @echo + @echo "Server Options: $(SERVER_OPT)" + @echo rm -f "$(PIDFILE)" rm -rf "$(VOCDIR)" @@ -5292,7 +5302,7 @@ unittests-make: .PHONY: unittests-boost -@ENABLE_BOOST_TEST_TRUE@unittests-boost: +@ENABLE_BOOST_TEST_TRUE@unittests-boost: UnitTests/basics_suite UnitTests/geo_suite @ENABLE_BOOST_TEST_TRUE@ @echo @ENABLE_BOOST_TEST_TRUE@ @echo "================================================================================" @ENABLE_BOOST_TEST_TRUE@ @echo "<< BOOST TESTS >>" @@ -5304,8 +5314,6 @@ unittests-make: @ENABLE_BOOST_TEST_TRUE@ @echo -@ENABLE_BOOST_TEST_TRUE@unittests-boost: UnitTests/basics_suite - @ENABLE_BOOST_TEST_FALSE@unittests-boost: @ENABLE_BOOST_TEST_FALSE@ @echo @ENABLE_BOOST_TEST_FALSE@ @echo "================================================================================" @@ -5355,7 +5363,7 @@ unittests-shell-server-ahuacatl: .PHONY: unittests-shell-client unittests-shell-client: - $(MAKE) start-server PID=$(PID) SERVER_OPT="--server.endpoint unix://$(VOCDIR)/arango.sock --server.disable-authentication true" PROTO=unix + $(MAKE) start-server PID=$(PID) SERVER_START="--server.endpoint unix://$(VOCDIR)/arango.sock --server.disable-authentication true" PROTO=unix @echo @echo "================================================================================" @@ -5379,7 +5387,7 @@ unittests-shell-client: .PHONY: unittests-http-server unittests-http-server: - $(MAKE) start-server PID=$(PID) SERVER_OPT="--server.endpoint tcp://$(VOCHOST):$(VOCPORT) --server.disable-auth true" PROTO=http + $(MAKE) start-server PID=$(PID) SERVER_START="--server.endpoint tcp://$(VOCHOST):$(VOCPORT) --server.disable-auth true" PROTO=http @echo @echo "================================================================================" @@ -5403,7 +5411,7 @@ unittests-http-server: .PHONY: unittests-ssl-server unittests-ssl-server: - $(MAKE) start-server PID=$(PID) SERVER_OPT="--server.endpoint ssl://$(VOCHOST):$(VOCPORT) --server.keyfile $(CERT_FILE) --server.disable-auth true" PROTO=https + $(MAKE) start-server PID=$(PID) SERVER_START="--server.endpoint ssl://$(VOCHOST):$(VOCPORT) --server.keyfile $(CERT_FILE) --server.disable-auth true" PROTO=https @echo @echo "================================================================================" @@ -5471,10 +5479,6 @@ clean-local: built-sources: build.h errorfiles $(JAVASCRIPT_HEADER) -################################################################################ -### @brief arango password -################################################################################ - bin/arango-password: bin/arango-password.in @ENABLE_RELATIVE_DEVEL_TRUE@ sed \ @ENABLE_RELATIVE_DEVEL_TRUE@ -e 's%@SBINDIR@%bin%g' \ @@ -5489,10 +5493,6 @@ bin/arango-password: bin/arango-password.in @ENABLE_RELATIVE_DEVEL_FALSE@ $< > $@ @ENABLE_RELATIVE_DEVEL_FALSE@ chmod 755 $@ -################################################################################ -### @brief arango datafile debugger -################################################################################ - bin/arango-dfdb: bin/arango-dfdb.in @ENABLE_RELATIVE_DEVEL_TRUE@ sed \ @ENABLE_RELATIVE_DEVEL_TRUE@ -e 's%@SBINDIR@%bin%g' \ @@ -5552,6 +5552,7 @@ Doxygen/js/server/modules/%.c: @srcdir@/js/server/modules/%.js Doxygen/.setup-di @python @top_srcdir@/Doxygen/Scripts/js2doxy.py $< > $@ Doxygen/xml/%.md: Doxygen/xml/%.xml + echo "CREATING XML FROM MD!!!" @python @top_srcdir@/Doxygen/Scripts/xml2md.py $< > $@ ################################################################################ @@ -5578,8 +5579,9 @@ Doxygen/arango-xml.doxy: Doxygen/arango.template sed -e 's:GENERATE_XML *= *NO:GENERATE_XML = YES:' -e 's:ENABLED_SECTIONS *=:ENABLED_SECTIONS = XML:' < $< > $@ $(MAKE) lib/BasicsC/voc-errors.h -wiki: wiki2 $(addsuffix .md,$(addprefix Doxygen/xml/,$(WIKI))) +wiki: wiki2 @test -d Doxygen/wiki || mkdir Doxygen/wiki + @for w in $(WIKI); do python @top_srcdir@/Doxygen/Scripts/xml2md.py Doxygen/xml/$$w.xml > Doxygen/xml/$$w.md; done @for w in $(WIKI); do @top_srcdir@/Doxygen/Scripts/fixmd.sh Doxygen/xml/$$w.md; done wiki2: Doxygen/arango-xml.doxy $(DOXYGEN) diff --git a/Makefile.local b/Makefile.local index 9576d1a3c7..6d3fb197ef 100644 --- a/Makefile.local +++ b/Makefile.local @@ -12,7 +12,7 @@ OUTPUT_FOLDER="Doxygen/manuals/$(PACKAGE_VERSION)" .PHONY: publish publish-wiki publish-html publish-pdf publish: publish-wiki publish-html publish-pdf - echo 'cd Doxygen/manuals && scp -r "$(PACKAGE_VERSION)" $(MANUAL_DST)' + cd Doxygen/manuals && scp -r "$(PACKAGE_VERSION)" $(MANUAL_DST) publish-wiki: (cd Doxygen/wiki && git checkout --force -- . && git clean -f -d -x && git pull) @@ -22,7 +22,7 @@ publish-wiki: publish-html: $(OUTPUT_FOLDER) $(MAKE) doxygen @for w in $(WIKI); do cp Doxygen/html/$$w.html $(OUTPUT_FOLDER); done - @for i in `ls Doxygen/web/images/*.png`; do scp $$i $(OUTPUT_FOLDER); done + @for i in `ls Doxygen/web/images/*.png`; do scp $$i $(OUTPUT_FOLDER)/images; done publish-pdf: $(OUTPUT_FOLDER) $(MAKE) latex @@ -35,4 +35,4 @@ publish-pdf: $(OUTPUT_FOLDER) scp arangod/Documentation/arangodb_1.0_shell_reference_card.pdf $(OUTPUT_FOLDER) $(OUTPUT_FOLDER): - mkdir -p $(OUTPUT_FOLDER) + mkdir -p $(OUTPUT_FOLDER)/images diff --git a/Makefile.unittests b/Makefile.unittests index 8fcab6389d..cff44b8dfc 100755 --- a/Makefile.unittests +++ b/Makefile.unittests @@ -57,7 +57,7 @@ VOCDIR := /tmp/vocdir.$(PID) VOCPORT := $(shell printf "3%04d" `expr $(PID) % 10000`) VOCHOST := 127.0.0.1 SERVER_START := -SERVER_OPT := --configuration none --javascript.startup-directory ./js --javascript.modules-path ./js/server/modules:./js/common/modules --javascript.action-directory ./js/actions/system $(SERVER_START) +SERVER_OPT := --configuration none --javascript.startup-directory ./js --javascript.modules-path ./js/server/modules:./js/common/modules --javascript.action-directory ./js/actions/system --database.maximal-journal-size 1000000 --javascript.gc-interval 1 $(SERVER_START) CLIENT_OPT := --javascript.startup-directory ./js --javascript.modules-path ./js/client/modules:./js/common/modules --no-colors --quiet STARTFILE := $(VOCDIR)/startup CURL := curl @@ -110,7 +110,7 @@ unittests-make: if ENABLE_BOOST_TEST -unittests-boost: +unittests-boost: UnitTests/basics_suite UnitTests/geo_suite @echo @echo "================================================================================" @echo "<< BOOST TESTS >>" @@ -122,8 +122,6 @@ unittests-boost: @echo -unittests-boost: UnitTests/basics_suite - noinst_PROGRAMS += UnitTests/basics_suite UnitTests/geo_suite UnitTests_basics_suite_LDADD = -L@top_builddir@/lib -larango -lboost_unit_test_framework @@ -223,6 +221,7 @@ SHELL_SERVER_AHUACATL = @srcdir@/js/server/tests/ahuacatl-ranges.js \ @srcdir@/js/server/tests/ahuacatl-skiplist.js \ @srcdir@/js/server/tests/ahuacatl-refaccess-variable.js \ @srcdir@/js/server/tests/ahuacatl-refaccess-attribute.js \ + @srcdir@/js/server/tests/ahuacatl-skiplist.js \ @srcdir@/js/server/tests/ahuacatl-queries-simple.js \ @srcdir@/js/server/tests/ahuacatl-queries-variables.js \ @srcdir@/js/server/tests/ahuacatl-queries-geo.js \ diff --git a/README.md b/README.md index ea5f93355b..1a1d961281 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # ArangoDB +[![Build Status](https://secure.travis-ci.org/timoschilling/ArangoDB.png?branch=master)](http://travis-ci.org/timoschilling/ArangoDB) We recently started a new open source project - a nosql database called AvocadoDB which became ArangoDB in May 2012. ArangoDB is diff --git a/VERSION b/VERSION index 31bca94953..d15f98f349 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.beta1 +1.0.beta2 diff --git a/arangod/BitIndexes/bitarrayIndex.c b/arangod/BitIndexes/bitarrayIndex.c index fdaf795621..d0f10a605a 100755 --- a/arangod/BitIndexes/bitarrayIndex.c +++ b/arangod/BitIndexes/bitarrayIndex.c @@ -499,7 +499,7 @@ void* BitarrayIndexPrevIterationCallback(TRI_index_iterator_t* iterator) { } if (iterator->_currentInterval >= iterator->_intervals._length) { - return false; + return NULL; } if (iterator->_intervals._length == 0) { diff --git a/arangod/Documentation/arangodb_1.0_shell_reference_card.docx b/arangod/Documentation/arangodb_1.0_shell_reference_card.docx index f5c3c756ea..7923ce8dec 100644 Binary files a/arangod/Documentation/arangodb_1.0_shell_reference_card.docx and b/arangod/Documentation/arangodb_1.0_shell_reference_card.docx differ diff --git a/arangod/Documentation/arangodb_1.0_shell_reference_card.pdf b/arangod/Documentation/arangodb_1.0_shell_reference_card.pdf old mode 100644 new mode 100755 index c5553a1a01..d4b4b17810 Binary files a/arangod/Documentation/arangodb_1.0_shell_reference_card.pdf and b/arangod/Documentation/arangodb_1.0_shell_reference_card.pdf differ diff --git a/arangod/RestServer/ArangoServer.cpp b/arangod/RestServer/ArangoServer.cpp index 30a0fb5d0c..5e58cc99fb 100644 --- a/arangod/RestServer/ArangoServer.cpp +++ b/arangod/RestServer/ArangoServer.cpp @@ -810,6 +810,9 @@ int ArangoServer::executeConsole (OperationMode::server_operation_mode_e mode) { } } + while(! v8::V8::IdleNotification()) { + } + if (ok) { // parameter array diff --git a/arangod/VocBase/barrier.c b/arangod/VocBase/barrier.c index 6144467f6e..f640ec7a0b 100644 --- a/arangod/VocBase/barrier.c +++ b/arangod/VocBase/barrier.c @@ -78,43 +78,46 @@ void TRI_DestroyBarrierList (TRI_barrier_list_t* container) { /// @brief creates a new barrier element //////////////////////////////////////////////////////////////////////////////// -TRI_barrier_t* TRI_CreateBarrierElement (TRI_barrier_list_t* container) { - TRI_barrier_t* element; +TRI_barrier_t* TRI_CreateBarrierElementZ (TRI_barrier_list_t* container, + size_t line, + char const* filename) { + TRI_barrier_blocker_t* element; - element = TRI_Allocate(TRI_UNKNOWN_MEM_ZONE, sizeof(TRI_barrier_t), false); + element = TRI_Allocate(TRI_UNKNOWN_MEM_ZONE, sizeof(TRI_barrier_blocker_t), false); if (element == NULL) { return NULL; } - element->_type = TRI_BARRIER_ELEMENT; - element->_container = container; - element->_datafile = NULL; - element->datafileCallback = NULL; + element->base._type = TRI_BARRIER_ELEMENT; + element->base._container = container; + + element->_line = line; + element->_filename = filename; TRI_LockSpin(&container->_lock); // empty list if (container->_end == NULL) { - element->_next = NULL; - element->_prev = NULL; + element->base._next = NULL; + element->base._prev = NULL; - container->_begin = element; - container->_end = element; + container->_begin = &element->base; + container->_end = &element->base; } // add to the end else { - element->_next = NULL; - element->_prev = container->_end; + element->base._next = NULL; + element->base._prev = container->_end; - container->_end->_next = element; - container->_end = element; + container->_end->_next = &element->base; + container->_end = &element->base; } TRI_UnlockSpin(&container->_lock); - return element; + return &element->base; } //////////////////////////////////////////////////////////////////////////////// diff --git a/arangod/VocBase/barrier.h b/arangod/VocBase/barrier.h index e2ac21d4e0..993be3d163 100644 --- a/arangod/VocBase/barrier.h +++ b/arangod/VocBase/barrier.h @@ -73,13 +73,21 @@ typedef struct TRI_barrier_s { struct TRI_barrier_list_s* _container; TRI_barrier_type_e _type; - - struct TRI_datafile_s* _datafile; - void* _datafileData; - void (*datafileCallback) (struct TRI_datafile_s*, void*); } TRI_barrier_t; +//////////////////////////////////////////////////////////////////////////////// +/// @brief barrier element blocker +//////////////////////////////////////////////////////////////////////////////// + +typedef struct TRI_barrier_blocker_s { + TRI_barrier_t base; + + size_t _line; + char const* _filename; +} +TRI_barrier_blocker_t; + //////////////////////////////////////////////////////////////////////////////// /// @brief barrier element datafile callback //////////////////////////////////////////////////////////////////////////////// @@ -149,7 +157,11 @@ void TRI_DestroyBarrierList (TRI_barrier_list_t* container); /// @brief creates a new barrier element //////////////////////////////////////////////////////////////////////////////// -TRI_barrier_t* TRI_CreateBarrierElement (TRI_barrier_list_t* container); +#define TRI_CreateBarrierElement(a) TRI_CreateBarrierElementZ((a), __LINE__, __FILE__) + +TRI_barrier_t* TRI_CreateBarrierElementZ (TRI_barrier_list_t* container, + size_t line, + char const* filename); //////////////////////////////////////////////////////////////////////////////// /// @brief creates a new datafile deletion barrier diff --git a/arangod/VocBase/compactor.c b/arangod/VocBase/compactor.c index dd33a5dc60..081a1b1b43 100644 --- a/arangod/VocBase/compactor.c +++ b/arangod/VocBase/compactor.c @@ -47,7 +47,7 @@ /// @brief compactify interval in microseconds //////////////////////////////////////////////////////////////////////////////// -static int const COMPACTOR_INTERVAL = 5 * 1000 * 1000; +static int const COMPACTOR_INTERVAL = 1 * 1000 * 1000; //////////////////////////////////////////////////////////////////////////////// /// @} diff --git a/configure b/configure index b2007f840a..c35fa8ff65 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for triAGENS ArangoDB 1.0.beta1. +# Generated by GNU Autoconf 2.68 for triAGENS ArangoDB 1.0.beta2. # # Report bugs to . # @@ -560,8 +560,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='triAGENS ArangoDB' PACKAGE_TARNAME='arangodb' -PACKAGE_VERSION='1.0.beta1' -PACKAGE_STRING='triAGENS ArangoDB 1.0.beta1' +PACKAGE_VERSION='1.0.beta2' +PACKAGE_STRING='triAGENS ArangoDB 1.0.beta2' PACKAGE_BUGREPORT='info@triagens.de' PACKAGE_URL='http://www.arangodb.org' @@ -1411,7 +1411,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures triAGENS ArangoDB 1.0.beta1 to adapt to many kinds of systems. +\`configure' configures triAGENS ArangoDB 1.0.beta2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1482,7 +1482,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of triAGENS ArangoDB 1.0.beta1:";; + short | recursive ) echo "Configuration of triAGENS ArangoDB 1.0.beta2:";; esac cat <<\_ACEOF @@ -1637,7 +1637,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -triAGENS ArangoDB configure 1.0.beta1 +triAGENS ArangoDB configure 1.0.beta2 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2102,7 +2102,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by triAGENS ArangoDB $as_me 1.0.beta1, which was +It was created by triAGENS ArangoDB $as_me 1.0.beta2, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -3241,7 +3241,7 @@ fi # Define the identity of the package. PACKAGE='arangodb' - VERSION='1.0.beta1' + VERSION='1.0.beta2' cat >>confdefs.h <<_ACEOF @@ -10267,7 +10267,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by triAGENS ArangoDB $as_me 1.0.beta1, which was +This file was extended by triAGENS ArangoDB $as_me 1.0.beta2, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -10334,7 +10334,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -triAGENS ArangoDB config.status 1.0.beta1 +triAGENS ArangoDB config.status 1.0.beta2 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index f5e795c746..8fbf15c15b 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ dnl ============================================================================ dnl --SECTION-- triAGENS GmbH Build Environment dnl ============================================================================ -AC_INIT([triAGENS ArangoDB], [1.0.beta1], [info@triagens.de], [arangodb], [http://www.arangodb.org]) +AC_INIT([triAGENS ArangoDB], [1.0.beta2], [info@triagens.de], [arangodb], [http://www.arangodb.org]) dnl ---------------------------------------------------------------------------- dnl auxillary directory for install-sh and missing diff --git a/js/client/client.js b/js/client/client.js index 1def7f9712..edc9ed6c71 100644 --- a/js/client/client.js +++ b/js/client/client.js @@ -2293,7 +2293,7 @@ function ArangoDatabase (connection) { }()); // ----------------------------------------------------------------------------- -// --SECTION-- ArangoEdgesCollection +// --SECTION-- ArangoEdgesCollection // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- diff --git a/js/client/js-client.h b/js/client/js-client.h index 66529935c0..be8fb6bfcf 100644 --- a/js/client/js-client.h +++ b/js/client/js-client.h @@ -2294,7 +2294,7 @@ static string JS_client_client = "}());\n" "\n" "// -----------------------------------------------------------------------------\n" - "// --SECTION-- ArangoEdgesCollection\n" + "// --SECTION-- ArangoEdgesCollection\n" "// -----------------------------------------------------------------------------\n" "\n" "// -----------------------------------------------------------------------------\n" diff --git a/js/common/bootstrap/js-modules.h b/js/common/bootstrap/js-modules.h index 2ab9150da7..e7f80e470a 100644 --- a/js/common/bootstrap/js-modules.h +++ b/js/common/bootstrap/js-modules.h @@ -279,6 +279,7 @@ static string JS_common_bootstrap_modules = " internal.sprintf = SYS_SPRINTF;\n" " internal.time = SYS_TIME;\n" " internal.sha256 = SYS_SHA256;\n" + " internal.wait = SYS_WAIT;\n" "\n" "\n" " // command line parameter\n" diff --git a/js/common/bootstrap/modules.js b/js/common/bootstrap/modules.js index 2bb1ff027c..0f553d1166 100644 --- a/js/common/bootstrap/modules.js +++ b/js/common/bootstrap/modules.js @@ -278,6 +278,7 @@ ModuleCache["/internal"] = new Module("/internal"); internal.sprintf = SYS_SPRINTF; internal.time = SYS_TIME; internal.sha256 = SYS_SHA256; + internal.wait = SYS_WAIT; // command line parameter diff --git a/js/common/modules/jsunity.js b/js/common/modules/jsunity.js index 4937810b1f..7fdf901abe 100644 --- a/js/common/modules/jsunity.js +++ b/js/common/modules/jsunity.js @@ -397,6 +397,8 @@ function RunCommandLineTests () { print(err.stack); result = false; } + + internal.wait(0); // force GC } SYS_UNIT_TESTS_RESULT = result; diff --git a/js/common/tests/shell-bitarray-index.js b/js/common/tests/shell-bitarray-index.js old mode 100755 new mode 100644 index 89d97e9212..87e6ecdef5 --- a/js/common/tests/shell-bitarray-index.js +++ b/js/common/tests/shell-bitarray-index.js @@ -35,6 +35,7 @@ var jsunity = require("jsunity"); var internal = require("internal"); +var console = require("console"); // ----------------------------------------------------------------------------- // --SECTION-- basic methods @@ -73,7 +74,19 @@ function BitarrayIndexSuite() { // ........................................................................... tearDown : function () { + collection.unload(); + + while (collection.status() != internal.ArangoCollection.STATUS_UNLOADED) { + console.log("waiting for collection '%s' to unload", cn); + internal.wait(1); + } + collection.drop(); + + while (collection.status() != internal.ArangoCollection.STATUS_DELETED) { + console.log("waiting for collection '%s' to drop", cn); + internal.wait(1); + } }, diff --git a/js/common/tests/shell-cap-constraint.js b/js/common/tests/shell-cap-constraint.js index 8894df286d..8ac6095de5 100644 --- a/js/common/tests/shell-cap-constraint.js +++ b/js/common/tests/shell-cap-constraint.js @@ -35,6 +35,7 @@ var jsunity = require("jsunity"); var internal = require("internal"); +var console = require("console"); // ----------------------------------------------------------------------------- // --SECTION-- basic methods @@ -65,7 +66,19 @@ function CapConstraintSuite() { //////////////////////////////////////////////////////////////////////////////// tearDown : function () { + collection.unload(); + + while (collection.status() != internal.ArangoCollection.STATUS_UNLOADED) { + console.log("waiting for collection '%s' to unload.", cn); + internal.wait(1); + } + collection.drop(); + + while (collection.status() != internal.ArangoCollection.STATUS_DELETED) { + console.log("waiting for collection '%s' to drop", cn); + internal.wait(1); + } }, //////////////////////////////////////////////////////////////////////////////// diff --git a/js/common/tests/shell-document.js b/js/common/tests/shell-document.js index 5ba6557357..7a4fffc0dc 100644 --- a/js/common/tests/shell-document.js +++ b/js/common/tests/shell-document.js @@ -27,6 +27,7 @@ var jsunity = require("jsunity"); var internal = require("internal"); +var console = require("console"); // ----------------------------------------------------------------------------- // --SECTION-- collection methods @@ -58,7 +59,19 @@ function CollectionDocumentSuiteErrorHandling () { //////////////////////////////////////////////////////////////////////////////// tearDown : function () { + collection.unload(); + + while (collection.status() != internal.ArangoCollection.STATUS_UNLOADED) { + console.log("waiting for collection '%s' to unload", cn); + internal.wait(1); + } + collection.drop(); + + while (collection.status() != internal.ArangoCollection.STATUS_DELETED) { + console.log("waiting for collection '%s' to drop", cn); + internal.wait(1); + } }, //////////////////////////////////////////////////////////////////////////////// diff --git a/js/common/tests/shell-edge.js b/js/common/tests/shell-edge.js index 1842843544..6f77ae8aa4 100644 --- a/js/common/tests/shell-edge.js +++ b/js/common/tests/shell-edge.js @@ -27,6 +27,7 @@ var jsunity = require("jsunity"); var internal = require("internal"); +var console = require("console"); // ----------------------------------------------------------------------------- // --SECTION-- collection methods @@ -70,8 +71,33 @@ function CollectionEdgeSuiteErrorHandling () { //////////////////////////////////////////////////////////////////////////////// tearDown : function () { + edge.unload(); + + while (edge.status() != internal.ArangoCollection.STATUS_UNLOADED) { + console.log("waiting for collection '%s' to unload", en); + internal.wait(1); + } + edge.drop(); + + while (edge.status() != internal.ArangoCollection.STATUS_DELETED) { + console.log("waiting for collection '%s' to drop", en); + internal.wait(1); + } + + vertex.unload(); + + while (vertex.status() != internal.ArangoCollection.STATUS_UNLOADED) { + console.log("waiting for collection '%s' to unload", vn); + internal.wait(1); + } + vertex.drop(); + + while (vertex.status() != internal.ArangoCollection.STATUS_DELETED) { + console.log("waiting for collection '%s' to drop", vn); + internal.wait(1); + } }, //////////////////////////////////////////////////////////////////////////////// diff --git a/js/common/tests/shell-hash-index.js b/js/common/tests/shell-hash-index.js index 30c5340bd5..3d4784605c 100644 --- a/js/common/tests/shell-hash-index.js +++ b/js/common/tests/shell-hash-index.js @@ -35,6 +35,7 @@ var jsunity = require("jsunity"); var internal = require("internal"); +var console = require("console"); // ----------------------------------------------------------------------------- // --SECTION-- basic methods @@ -65,7 +66,19 @@ function HashIndexSuite() { //////////////////////////////////////////////////////////////////////////////// tearDown : function () { + collection.unload(); + + while (collection.status() != internal.ArangoCollection.STATUS_UNLOADED) { + console.log("waiting for collection '%s' to unload", cn); + internal.wait(1); + } + collection.drop(); + + while (collection.status() != internal.ArangoCollection.STATUS_DELETED) { + console.log("waiting for collection '%s' to drop", cn); + internal.wait(1); + } }, //////////////////////////////////////////////////////////////////////////////// diff --git a/js/common/tests/shell-index-geo.js b/js/common/tests/shell-index-geo.js index 033bcec81c..d59cc4c86e 100644 --- a/js/common/tests/shell-index-geo.js +++ b/js/common/tests/shell-index-geo.js @@ -65,7 +65,19 @@ function GeoIndexCreationSuite() { //////////////////////////////////////////////////////////////////////////////// tearDown : function () { + collection.unload(); + + while (collection.status() != internal.ArangoCollection.STATUS_UNLOADED) { + console.log("waiting for collection '%s' to unload", cn); + internal.wait(1); + } + collection.drop(); + + while (collection.status() != internal.ArangoCollection.STATUS_DELETED) { + console.log("waiting for collection '%s' to drop", cn); + internal.wait(1); + } }, //////////////////////////////////////////////////////////////////////////////// diff --git a/js/common/tests/shell-index.js b/js/common/tests/shell-index.js index 525554c504..47f3beb432 100644 --- a/js/common/tests/shell-index.js +++ b/js/common/tests/shell-index.js @@ -35,6 +35,7 @@ var jsunity = require("jsunity"); var internal = require("internal"); +var console = require("console"); // ----------------------------------------------------------------------------- // --SECTION-- basic methods @@ -64,7 +65,19 @@ function indexSuite() { //////////////////////////////////////////////////////////////////////////////// tearDown : function () { + collection.unload(); + + while (collection.status() != internal.ArangoCollection.STATUS_UNLOADED) { + console.log("waiting for collection '%s' to unload", cn); + internal.wait(1); + } + collection.drop(); + + while (collection.status() != internal.ArangoCollection.STATUS_DELETED) { + console.log("waiting for collection '%s' to drop", cn); + internal.wait(1); + } }, //////////////////////////////////////////////////////////////////////////////// diff --git a/js/common/tests/shell-unique-constraint.js b/js/common/tests/shell-unique-constraint.js index caa2c39337..e7aa8dc800 100644 --- a/js/common/tests/shell-unique-constraint.js +++ b/js/common/tests/shell-unique-constraint.js @@ -35,6 +35,7 @@ var jsunity = require("jsunity"); var internal = require("internal"); +var console = require("console"); // ----------------------------------------------------------------------------- // --SECTION-- basic methods @@ -65,7 +66,19 @@ function UniqueConstraintSuite() { //////////////////////////////////////////////////////////////////////////////// tearDown : function () { + collection.unload(); + + while (collection.status() != internal.ArangoCollection.STATUS_UNLOADED) { + console.log("waiting for collection '%s' to unload", cn); + internal.wait(1); + } + collection.drop(); + + while (collection.status() != internal.ArangoCollection.STATUS_DELETED) { + console.log("waiting for collection '%s' to drop", cn); + internal.wait(1); + } }, //////////////////////////////////////////////////////////////////////////////// diff --git a/lib/BasicsC/associative-multi.c b/lib/BasicsC/associative-multi.c index ce0bfcae5a..bbdb7ed443 100644 --- a/lib/BasicsC/associative-multi.c +++ b/lib/BasicsC/associative-multi.c @@ -725,7 +725,7 @@ void* TRI_InsertElementMultiPointer (TRI_multi_pointer_t* array, void* element, // check for out-of-memory if (array->_nrAlloc == array->_nrUsed) { - return false; + return NULL; } // compute the hash diff --git a/lib/BasicsC/memory.c b/lib/BasicsC/memory.c index 0184a6c903..71b4d6960e 100644 --- a/lib/BasicsC/memory.c +++ b/lib/BasicsC/memory.c @@ -27,6 +27,8 @@ #include "BasicsC/common.h" +#include "BasicsC/logging.h" + // ----------------------------------------------------------------------------- // --SECTION-- private variables // ----------------------------------------------------------------------------- @@ -64,6 +66,12 @@ static TRI_memory_zone_t TriCoreMemZone; static TRI_memory_zone_t TriUnknownMemZone; +//////////////////////////////////////////////////////////////////////////////// +/// @brief memory reserve for core memory zone +//////////////////////////////////////////////////////////////////////////////// + +static void* CoreReserve; + //////////////////////////////////////////////////////////////////////////////// /// @} //////////////////////////////////////////////////////////////////////////////// @@ -176,8 +184,23 @@ void* TRI_Allocate (TRI_memory_zone_t* zone, uint64_t n, bool set) { return NULL; } - printf("PANIC: failed to allocate memory in zone '%d', giving up!", zone->_zid); - exit(EXIT_FAILURE); + if (CoreReserve == NULL) { + printf("FATAL: failed to allocate memory in zone '%d', giving up!", zone->_zid); + exit(EXIT_FAILURE); + } + + free(CoreReserve); + CoreReserve = NULL; + + LOG_FATAL("failed to allocate memory in zone '%d' of size '%ld', retrying!", + (int) zone->_zid, + (unsigned long) n); + +#ifdef TRI_ENABLE_ZONE_DEBUG + return TRI_AllocateZ(zone, n, set, file, line); +#else + return TRI_Allocate(zone, n, set); +#endif } #ifdef TRI_ENABLE_ZONE_DEBUG else if (set) { @@ -256,8 +279,23 @@ void* TRI_Reallocate (TRI_memory_zone_t* zone, void* m, uint64_t n) { return NULL; } - printf("PANIC: failed to allocate memory in zone '%d', giving up!", zone->_zid); - exit(EXIT_FAILURE); + if (CoreReserve == NULL) { + printf("FATAL: failed to allocate memory in zone '%d', giving up!", zone->_zid); + exit(EXIT_FAILURE); + } + + free(CoreReserve); + CoreReserve = NULL; + + LOG_FATAL("failed to allocate memory in zone '%d' of size '%ld', retrying!", + (int) zone->_zid, + (unsigned long) n); + +#ifdef TRI_ENABLE_ZONE_DEBUG + return TRI_ReallocateZ(zone, m, n, file, line); +#else + return TRI_Reallocate(zone, m, n); +#endif } return p; @@ -297,6 +335,7 @@ void TRI_Free (TRI_memory_zone_t* zone, void* m) { void TRI_InitialiseMemory () { static bool initialised = false; + static size_t const reserveSize = 1024 * 1024 * 10; if (! initialised) { TriCoreMemZone._zid = 0; @@ -305,7 +344,14 @@ void TRI_InitialiseMemory () { TriUnknownMemZone._zid = 1; TriUnknownMemZone._failed = false; - TriUnknownMemZone._failable = true; + TriUnknownMemZone._failable = false; + + CoreReserve = malloc(reserveSize); + + if (CoreReserve == NULL) { + fprintf(stderr, "FATAL: cannot allocate initial core reserve of size %ld, giving up!\n", + (unsigned long) reserveSize); + } } } diff --git a/lib/Rest/AnyServer.cpp b/lib/Rest/AnyServer.cpp index f90963bac7..cedb2b22f7 100644 --- a/lib/Rest/AnyServer.cpp +++ b/lib/Rest/AnyServer.cpp @@ -362,7 +362,7 @@ int AnyServer::startupSupervisor () { } // parent - if (pid > 0) { + if (0 < pid) { char const* title = "arangodb [supervisor]"; TRI_SetProcessTitle(title); @@ -371,17 +371,17 @@ int AnyServer::startupSupervisor () { prctl(PR_SET_NAME, title, 0, 0, 0); #endif - WritePidFile(_pidFile, pid); - int status; waitpid(pid, &status, 0); + bool horrible = true; if (WIFEXITED(status)) { - // give information about cause of death + // give information about cause of death if (WEXITSTATUS(status) == 0) { LOGGER_INFO << "child " << pid << " died of natural causes"; done = true; + horrible = false; } else { t = time(0) - startTime; @@ -405,6 +405,7 @@ int AnyServer::startupSupervisor () { case 15: LOGGER_INFO << "child " << pid << " died of natural causes " << WTERMSIG(status); done = true; + horrible = false; break; default: @@ -427,11 +428,27 @@ int AnyServer::startupSupervisor () { LOGGER_ERROR << "child " << pid << " died a horrible death, unknown cause"; done = false; } + + // remove pid file + if (horrible) { + if (FileUtils::changeDirectory(current)) { + if (! FileUtils::remove(_pidFile)) { + LOGGER_ERROR << "cannot unlink pid file '" << _pidFile << "'"; + } + } + else { + LOGGER_ERROR << "cannot unlink pid file '" << _pidFile << "', because directory '" + << current << "' is missing"; + } + } } // child else { + // write the pid file + WritePidFile(_pidFile, TRI_CurrentProcessId()); + // reset logging TRI_InitialiseLogging(TRI_ResetLogging()); safe_cast(_applicationServer)->setupLogging(); @@ -445,32 +462,21 @@ int AnyServer::startupSupervisor () { prepareServer(); result = startupServer(); - // remove pid file - if (FileUtils::changeDirectory(current)) { - if (! FileUtils::remove(_pidFile)) { - LOGGER_ERROR << "cannot unlink pid file '" << _pidFile << "'"; - } - } - else { - LOGGER_ERROR << "cannot unlink pid file '" << _pidFile << "', because directory '" - << current << "' is missing"; - } + // remove pid file + if (FileUtils::changeDirectory(current)) { + if (! FileUtils::remove(_pidFile)) { + LOGGER_ERROR << "cannot unlink pid file '" << _pidFile << "'"; + } + } + else { + LOGGER_ERROR << "cannot unlink pid file '" << _pidFile << "', because directory '" + << current << "' is missing"; + } // and stop exit(result); } } - - // remove pid file - if (FileUtils::changeDirectory(current)) { - if (! FileUtils::remove(_pidFile)) { - LOGGER_ERROR << "cannot unlink pid file '" << _pidFile << "'"; - } - } - else { - LOGGER_ERROR << "cannot unlink pid file '" << _pidFile << "', because directory '" - << current << "' is missing"; - } } return result; diff --git a/lib/V8/v8-utils.cpp b/lib/V8/v8-utils.cpp index 569a9a2292..042ed983c0 100644 --- a/lib/V8/v8-utils.cpp +++ b/lib/V8/v8-utils.cpp @@ -1103,6 +1103,38 @@ static v8::Handle JS_Time (v8::Arguments const& argv) { return scope.Close(v8::Number::New(TRI_microtime())); } +//////////////////////////////////////////////////////////////////////////////// +/// @brief returns the current time +/// +/// @FUN{internal.wait()} +/// +/// Wait for , call the garbage collection. +//////////////////////////////////////////////////////////////////////////////// + +static v8::Handle JS_Wait (v8::Arguments const& argv) { + v8::HandleScope scope; + + // extract arguments + if (argv.Length() != 1) { + return scope.Close(v8::ThrowException(v8::String::New("usage: wait()"))); + } + + double n = TRI_ObjectToDouble(argv[0]); + double until = TRI_microtime() + n; + + while(! v8::V8::IdleNotification()) { + } + + while (TRI_microtime() < until) { + while(! v8::V8::IdleNotification()) { + } + + usleep(100); + } + + return scope.Close(v8::Undefined()); +} + //////////////////////////////////////////////////////////////////////////////// /// @} //////////////////////////////////////////////////////////////////////////////// @@ -1508,6 +1540,10 @@ void TRI_InitV8Utils (v8::Handle context, string const& path) { v8::FunctionTemplate::New(JS_Time)->GetFunction(), v8::ReadOnly); + context->Global()->Set(v8::String::New("SYS_WAIT"), + v8::FunctionTemplate::New(JS_Wait)->GetFunction(), + v8::ReadOnly); + // ............................................................................. // create the global variables // ............................................................................. diff --git a/packetize.sh b/packetize.sh index 30e47d682d..b4ae1a5d0e 100755 --- a/packetize.sh +++ b/packetize.sh @@ -61,6 +61,9 @@ case $TRI_OS_LONG in START_SCRIPT="rc.arangodb.OpenSuSE" runlevels="035" docdir=${prefix}/share/doc/packages/voc/${vers_dir} + + # exports for the epm configuration file + export insserv="true" ;; Linux-Debian*) @@ -158,7 +161,7 @@ export EPM_RPM_OPTION test -f ${SUBLIST} && rm -f ${SUBLIST} touch ${SUBLIST} -share_base=${static_dir}/arango +share_base=${static_dir}/arangodb sfolder_name=$(pwd) echo @@ -196,10 +199,12 @@ echo "Export vars for epm" echo " export arangodb_release=$arangodb_release" echo " export arangodb_version=$arangodb_version" echo " export bindir=$bindir" +echo " export chkconf=$chkconf" echo " export data_dir=$data_dir" echo " export docdir=$docdir" echo " export exec_prefix=$exec_prefix" echo " export initdir=$initdir" +echo " export insserv=$insserv" echo " export prefix=$prefix" echo " export project_dir=${sfolder_name}" echo " export rgrp=$rgrp"