From 31cacfb9f916f4e475ab60ba72ccc3dad1f6105b Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Wed, 28 Oct 2015 11:22:58 +0100 Subject: [PATCH 01/25] do not allow remaining in already-deleted database with _useDatabase() --- arangod/V8Server/v8-collection.cpp | 4 ++++ arangod/V8Server/v8-util.cpp | 16 ++++++++-------- arangod/V8Server/v8-vocbase.cpp | 4 ++++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/arangod/V8Server/v8-collection.cpp b/arangod/V8Server/v8-collection.cpp index 096e1f57e2..d84d591abf 100644 --- a/arangod/V8Server/v8-collection.cpp +++ b/arangod/V8Server/v8-collection.cpp @@ -3734,6 +3734,10 @@ static void JS_CollectionVocbase (const v8::FunctionCallbackInfo& arg TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_DATABASE_NOT_FOUND); } + if (TRI_IsDeletedVocBase(vocbase)) { + TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_DATABASE_NOT_FOUND); + } + // expecting one argument if (args.Length() != 1) { TRI_V8_THROW_EXCEPTION_USAGE("_collection(|)"); diff --git a/arangod/V8Server/v8-util.cpp b/arangod/V8Server/v8-util.cpp index c65d4ae511..7366f0b7e2 100644 --- a/arangod/V8Server/v8-util.cpp +++ b/arangod/V8Server/v8-util.cpp @@ -54,9 +54,9 @@ TRI_vocbase_t* GetContextVocBase (v8::Isolate* isolate) { v8::Handle V8TickId (v8::Isolate* isolate, TRI_voc_tick_t tick) { char buffer[21]; - size_t len = TRI_StringUInt64InPlace((uint64_t) tick, (char*) &buffer); + size_t len = TRI_StringUInt64InPlace(static_cast(tick), &buffer[0]); - return TRI_V8_PAIR_STRING((char const*) buffer, (int) len); + return TRI_V8_PAIR_STRING(&buffer[0], static_cast(len)); } //////////////////////////////////////////////////////////////////////////////// @@ -65,9 +65,9 @@ v8::Handle V8TickId (v8::Isolate* isolate, TRI_voc_tick_t tick) { v8::Handle V8RevisionId (v8::Isolate* isolate, TRI_voc_rid_t rid) { char buffer[21]; - size_t len = TRI_StringUInt64InPlace((uint64_t) rid, (char*) &buffer); + size_t len = TRI_StringUInt64InPlace(static_cast(rid), &buffer[0]); - return TRI_V8_PAIR_STRING((char const*) buffer, (int) len); + return TRI_V8_PAIR_STRING(&buffer[0], static_cast(len)); } //////////////////////////////////////////////////////////////////////////////// @@ -75,9 +75,9 @@ v8::Handle V8RevisionId (v8::Isolate* isolate, TRI_voc_rid_t rid) { //////////////////////////////////////////////////////////////////////////////// v8::Handle V8DocumentId (v8::Isolate* isolate, - string const& collectionName, - string const& key) { - string const&& id = DocumentHelper::assembleDocumentId(collectionName, key); + std::string const& collectionName, + std::string const& key) { + std::string const&& id = DocumentHelper::assembleDocumentId(collectionName, key); return TRI_V8_STD_STRING(id); } @@ -87,7 +87,7 @@ v8::Handle V8DocumentId (v8::Isolate* isolate, //////////////////////////////////////////////////////////////////////////////// static bool ParseDocumentHandle (v8::Handle const arg, - string& collectionName, + std::string& collectionName, std::unique_ptr& key) { TRI_ASSERT(collectionName.empty()); diff --git a/arangod/V8Server/v8-vocbase.cpp b/arangod/V8Server/v8-vocbase.cpp index 81b12ace69..102e5f66d3 100644 --- a/arangod/V8Server/v8-vocbase.cpp +++ b/arangod/V8Server/v8-vocbase.cpp @@ -3140,6 +3140,10 @@ static void JS_UseDatabase (const v8::FunctionCallbackInfo& args) { TRI_V8_THROW_EXCEPTION(TRI_ERROR_INTERNAL); } + if (TRI_IsDeletedVocBase(vocbase)) { + TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_DATABASE_NOT_FOUND); + } + if (TRI_EqualString(name.c_str(), vocbase->_name)) { // same database. nothing to do TRI_V8_RETURN(WrapVocBase(isolate, vocbase)); From 01499dde43c478ccd8841c7d4417b7b42375222f Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Thu, 29 Oct 2015 11:57:22 +0100 Subject: [PATCH 02/25] added deadlock detection for lazy locking of collections --- arangod/VocBase/document-collection.cpp | 110 +++++++- arangod/VocBase/document-collection.h | 1 - arangod/VocBase/transaction.cpp | 19 +- arangod/VocBase/vocbase.h | 3 + arangosh/Benchmark/test-cases.h | 76 ++++++ .../APP/frontend/js/bootstrap/errors.js | 1 + js/common/bootstrap/errors.js | 1 + lib/Basics/DeadlockDetector.h | 257 ++++++++++++++++++ lib/Basics/errors.dat | 1 + lib/Basics/voc-errors.cpp | 1 + lib/Basics/voc-errors.h | 12 + 11 files changed, 463 insertions(+), 19 deletions(-) create mode 100644 lib/Basics/DeadlockDetector.h diff --git a/arangod/VocBase/document-collection.cpp b/arangod/VocBase/document-collection.cpp index 3309faa77d..066f1d6155 100644 --- a/arangod/VocBase/document-collection.cpp +++ b/arangod/VocBase/document-collection.cpp @@ -63,8 +63,6 @@ #include "Wal/Marker.h" #include "Wal/Slots.h" -#include - using namespace triagens::arango; //////////////////////////////////////////////////////////////////////////////// @@ -117,7 +115,9 @@ void TRI_doc_mptr_copy_t::setDataPtr (void const* d) { //////////////////////////////////////////////////////////////////////////////// TRI_document_collection_t::TRI_document_collection_t () - : _useSecondaryIndexes(true), + : _lock(), + _shaper(nullptr), + _useSecondaryIndexes(true), _capConstraint(nullptr), _ditches(this), _headersPtr(nullptr), @@ -199,6 +199,14 @@ int TRI_document_collection_t::beginWrite () { // std::cout << "BeginWrite: " << document->_info._name << std::endl; TRI_WRITE_LOCK_DOCUMENTS_INDEXES_PRIMARY_COLLECTION(this); + try { + _vocbase->_deadlockDetector.setWriterStarted(this); + } + catch (...) { + TRI_WRITE_UNLOCK_DOCUMENTS_INDEXES_PRIMARY_COLLECTION(this); + return TRI_ERROR_OUT_OF_MEMORY; + } + return TRI_ERROR_NO_ERROR; } @@ -220,6 +228,12 @@ int TRI_document_collection_t::endWrite () { // LOCKING-DEBUG // std::cout << "EndWrite: " << document->_info._name << std::endl; TRI_WRITE_UNLOCK_DOCUMENTS_INDEXES_PRIMARY_COLLECTION(this); + + try { + _vocbase->_deadlockDetector.setWriterFinished(this); + } + catch (...) { + } return TRI_ERROR_NO_ERROR; } @@ -241,10 +255,45 @@ int TRI_document_collection_t::beginReadTimed (uint64_t timeout, } } uint64_t waited = 0; + if (timeout == 0) { + // we don't allow looping forever. limit waiting to 15 minutes max. + timeout = 15 * 60 * 1000 * 1000; + } // LOCKING-DEBUG // std::cout << "BeginReadTimed: " << document->_info._name << std::endl; + int iterations = 0; + bool wasBlocked = false; + while (! TRI_TRY_READ_LOCK_DOCUMENTS_INDEXES_PRIMARY_COLLECTION(this)) { + try { + if (! wasBlocked) { + // insert reader + if (_vocbase->_deadlockDetector.setReaderBlocked(this)) { + // deadlock + return TRI_ERROR_DEADLOCK; + } + wasBlocked = true; + } + else if (++iterations >= 5) { + // periodically check for deadlocks + TRI_ASSERT(wasBlocked); + iterations = 0; + if (_vocbase->_deadlockDetector.isDeadlocked(this)) { + // deadlock + _vocbase->_deadlockDetector.setReaderUnblocked(this); + return TRI_ERROR_DEADLOCK; + } + } + } + catch (...) { + // clean up! + if (wasBlocked) { + _vocbase->_deadlockDetector.setReaderUnblocked(this); + return TRI_ERROR_OUT_OF_MEMORY; + } + } + #ifdef _WIN32 usleep((unsigned long) sleepPeriod); #else @@ -254,10 +303,16 @@ int TRI_document_collection_t::beginReadTimed (uint64_t timeout, waited += sleepPeriod; if (waited > timeout) { + _vocbase->_deadlockDetector.setReaderUnblocked(this); return TRI_ERROR_LOCK_TIMEOUT; } } + // when we are here, we've got the read lock + if (wasBlocked) { + _vocbase->_deadlockDetector.setReaderUnblocked(this); + } + return TRI_ERROR_NO_ERROR; } @@ -278,10 +333,45 @@ int TRI_document_collection_t::beginWriteTimed (uint64_t timeout, } } uint64_t waited = 0; + if (timeout == 0) { + // we don't allow looping forever. limit waiting to 15 minutes max. + timeout = 15 * 60 * 1000 * 1000; + } // LOCKING-DEBUG // std::cout << "BeginWriteTimed: " << document->_info._name << std::endl; + int iterations = 0; + bool wasBlocked = false; + while (! TRI_TRY_WRITE_LOCK_DOCUMENTS_INDEXES_PRIMARY_COLLECTION(this)) { + try { + if (! wasBlocked) { + // insert writer (with method named "setReaderBlocked"..., but it works) + if (_vocbase->_deadlockDetector.setReaderBlocked(this)) { + // deadlock + return TRI_ERROR_DEADLOCK; + } + wasBlocked = true; + } + else if (++iterations >= 5) { + // periodically check for deadlocks + TRI_ASSERT(wasBlocked); + iterations = 0; + if (_vocbase->_deadlockDetector.isDeadlocked(this)) { + // deadlock + _vocbase->_deadlockDetector.setReaderUnblocked(this); + return TRI_ERROR_DEADLOCK; + } + } + } + catch (...) { + // clean up! + if (wasBlocked) { + _vocbase->_deadlockDetector.setReaderUnblocked(this); + return TRI_ERROR_OUT_OF_MEMORY; + } + } + #ifdef _WIN32 usleep((unsigned long) sleepPeriod); #else @@ -291,9 +381,23 @@ int TRI_document_collection_t::beginWriteTimed (uint64_t timeout, waited += sleepPeriod; if (waited > timeout) { + _vocbase->_deadlockDetector.setReaderUnblocked(this); return TRI_ERROR_LOCK_TIMEOUT; } } + + // when we are here, we've got the write lock + if (wasBlocked) { + _vocbase->_deadlockDetector.setReaderUnblocked(this); + } + + try { + _vocbase->_deadlockDetector.setWriterStarted(this); + } + catch (...) { + TRI_WRITE_UNLOCK_DOCUMENTS_INDEXES_PRIMARY_COLLECTION(this); + return TRI_ERROR_OUT_OF_MEMORY; + } return TRI_ERROR_NO_ERROR; } diff --git a/arangod/VocBase/document-collection.h b/arangod/VocBase/document-collection.h index 5a5050396a..28e5209453 100644 --- a/arangod/VocBase/document-collection.h +++ b/arangod/VocBase/document-collection.h @@ -364,7 +364,6 @@ struct TRI_document_collection_t : public TRI_collection_t { // TRI_read_write_lock_t _lock; triagens::basics::ReadWriteLockCPP11 _lock; - private: VocShaper* _shaper; diff --git a/arangod/VocBase/transaction.cpp b/arangod/VocBase/transaction.cpp index 3193423023..d4233ce8a5 100644 --- a/arangod/VocBase/transaction.cpp +++ b/arangod/VocBase/transaction.cpp @@ -365,8 +365,6 @@ static void FreeDitch (TRI_transaction_collection_t* trxCollection) { static int LockCollection (TRI_transaction_collection_t* trxCollection, TRI_transaction_type_e type, int nestingLevel) { - int res; - TRI_ASSERT(trxCollection != nullptr); TRI_transaction_t* trx = trxCollection->_transaction; @@ -394,29 +392,20 @@ static int LockCollection (TRI_transaction_collection_t* trxCollection, TRI_document_collection_t* document = trxCollection->_collection->_collection; + int res; if (type == TRI_TRANSACTION_READ) { LOG_TRX(trx, nestingLevel, "read-locking collection %llu", (unsigned long long) trxCollection->_cid); - if (trx->_timeout == 0) { - res = document->beginRead(); - } - else { - res = document->beginReadTimed(trx->_timeout, TRI_TRANSACTION_DEFAULT_SLEEP_DURATION); - } + res = document->beginReadTimed(trx->_timeout, TRI_TRANSACTION_DEFAULT_SLEEP_DURATION); } else { LOG_TRX(trx, nestingLevel, "write-locking collection %llu", (unsigned long long) trxCollection->_cid); - if (trx->_timeout == 0) { - res = document->beginWrite(); - } - else { - res = document->beginWriteTimed(trx->_timeout, TRI_TRANSACTION_DEFAULT_SLEEP_DURATION); - } + res = document->beginWriteTimed(trx->_timeout, TRI_TRANSACTION_DEFAULT_SLEEP_DURATION * 50); } if (res == TRI_ERROR_NO_ERROR) { @@ -816,7 +805,7 @@ TRI_transaction_t* TRI_CreateTransaction (TRI_vocbase_t* vocbase, trx->_timeout = (uint64_t) (timeout * 1000000.0); } else if (timeout == 0.0) { - trx->_timeout = (uint64_t) 0; + trx->_timeout = static_cast(0); } TRI_InitVectorPointer(&trx->_collections, TRI_UNKNOWN_MEM_ZONE, 2); diff --git a/arangod/VocBase/vocbase.h b/arangod/VocBase/vocbase.h index 36e059517d..644aaaff67 100644 --- a/arangod/VocBase/vocbase.h +++ b/arangod/VocBase/vocbase.h @@ -32,6 +32,7 @@ #include "Basics/Common.h" #include "Basics/associative.h" +#include "Basics/DeadlockDetector.h" #include "Basics/locks.h" #include "Basics/ReadWriteLock.h" #include "Basics/threads.h" @@ -274,6 +275,8 @@ struct TRI_vocbase_t { TRI_server_t* _server; TRI_vocbase_defaults_t _settings; + triagens::basics::DeadlockDetector _deadlockDetector; + triagens::basics::ReadWriteLock _collectionsLock; // collection iterator lock std::vector _collections; // pointers to ALL collections std::vector _deadCollections; // pointers to collections dropped that can be removed later diff --git a/arangosh/Benchmark/test-cases.h b/arangosh/Benchmark/test-cases.h index 41125bd006..e2ed7ba4af 100644 --- a/arangosh/Benchmark/test-cases.h +++ b/arangosh/Benchmark/test-cases.h @@ -1290,6 +1290,79 @@ struct TransactionCountTest : public BenchmarkOperation { }; +// ----------------------------------------------------------------------------- +// --SECTION-- transaction deadlock test +// ----------------------------------------------------------------------------- + +struct TransactionDeadlockTest : public BenchmarkOperation { + TransactionDeadlockTest () + : BenchmarkOperation () { + } + + ~TransactionDeadlockTest () { + } + + bool setUp (SimpleHttpClient* client) { + _c1 = std::string(Collection + "1"); + _c2 = std::string(Collection + "2"); + + return DeleteCollection(client, _c1) && + DeleteCollection(client, _c2) && + CreateCollection(client, _c1, 2) && + CreateCollection(client, _c2, 2) && + CreateDocument(client, _c2, "{ \"_key\": \"sum\", \"count\": 0 }"); + } + + void tearDown () { + } + + std::string url (const int threadNumber, const size_t threadCounter, const size_t globalCounter) { + return std::string("/_api/transaction"); + } + + HttpRequest::HttpRequestType type (const int threadNumber, const size_t threadCounter, const size_t globalCounter) { + return HttpRequest::HTTP_REQUEST_POST; + } + + const char* payload (size_t* length, const int threadNumber, const size_t threadCounter, const size_t globalCounter, bool* mustFree) { + const size_t mod = globalCounter % 2; + TRI_string_buffer_t* buffer; + buffer = TRI_CreateSizedStringBuffer(TRI_UNKNOWN_MEM_ZONE, 256); + + TRI_AppendStringStringBuffer(buffer, "{ \"collections\": { "); + TRI_AppendStringStringBuffer(buffer, "\"write\": [ \""); + + if (mod == 0) { + TRI_AppendStringStringBuffer(buffer, _c1.c_str()); + } + else { + TRI_AppendStringStringBuffer(buffer, _c2.c_str()); + } + + TRI_AppendStringStringBuffer(buffer, "\" ] }, \"action\": \"function () { "); + TRI_AppendStringStringBuffer(buffer, "var c = require(\\\"internal\\\").db[\\\""); + if (mod == 0) { + TRI_AppendStringStringBuffer(buffer, _c2.c_str()); + } + else { + TRI_AppendStringStringBuffer(buffer, _c1.c_str()); + } + TRI_AppendStringStringBuffer(buffer, "\\\"]; c.any();"); + + TRI_AppendStringStringBuffer(buffer, " }\" }"); + + *length = TRI_LengthStringBuffer(buffer); + *mustFree = true; + char* ptr = TRI_StealStringBuffer(buffer); + TRI_FreeStringBuffer(TRI_UNKNOWN_MEM_ZONE, buffer); + + return (const char*) ptr; + } + + std::string _c1; + std::string _c2; +}; + // ----------------------------------------------------------------------------- // --SECTION-- transaction test // ----------------------------------------------------------------------------- @@ -1738,6 +1811,9 @@ static BenchmarkOperation* GetTestCase (const std::string& name) { if (name == "multitrx") { return new TransactionMultiTest(); } + if (name == "deadlocktrx") { + return new TransactionDeadlockTest(); + } if (name == "multi-collection") { return new TransactionMultiCollectionTest(); } diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/bootstrap/errors.js b/js/apps/system/_admin/aardvark/APP/frontend/js/bootstrap/errors.js index 6d4f390bdb..ed7e62ff9e 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/bootstrap/errors.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/bootstrap/errors.js @@ -39,6 +39,7 @@ "ERROR_LEGEND_NOT_IN_WAL_FILE" : { "code" : 26, "message" : "internal error if a legend for a marker does not yet exist in the same WAL file" }, "ERROR_FILE_EXISTS" : { "code" : 27, "message" : "file exists" }, "ERROR_LOCKED" : { "code" : 28, "message" : "locked" }, + "ERROR_DEADLOCK" : { "code" : 29, "message" : "deadlock detected" }, "ERROR_HTTP_BAD_PARAMETER" : { "code" : 400, "message" : "bad parameter" }, "ERROR_HTTP_UNAUTHORIZED" : { "code" : 401, "message" : "unauthorized" }, "ERROR_HTTP_FORBIDDEN" : { "code" : 403, "message" : "forbidden" }, diff --git a/js/common/bootstrap/errors.js b/js/common/bootstrap/errors.js index 6d4f390bdb..ed7e62ff9e 100644 --- a/js/common/bootstrap/errors.js +++ b/js/common/bootstrap/errors.js @@ -39,6 +39,7 @@ "ERROR_LEGEND_NOT_IN_WAL_FILE" : { "code" : 26, "message" : "internal error if a legend for a marker does not yet exist in the same WAL file" }, "ERROR_FILE_EXISTS" : { "code" : 27, "message" : "file exists" }, "ERROR_LOCKED" : { "code" : 28, "message" : "locked" }, + "ERROR_DEADLOCK" : { "code" : 29, "message" : "deadlock detected" }, "ERROR_HTTP_BAD_PARAMETER" : { "code" : 400, "message" : "bad parameter" }, "ERROR_HTTP_UNAUTHORIZED" : { "code" : 401, "message" : "unauthorized" }, "ERROR_HTTP_FORBIDDEN" : { "code" : 403, "message" : "forbidden" }, diff --git a/lib/Basics/DeadlockDetector.h b/lib/Basics/DeadlockDetector.h new file mode 100644 index 0000000000..4d2dc3bee6 --- /dev/null +++ b/lib/Basics/DeadlockDetector.h @@ -0,0 +1,257 @@ +//////////////////////////////////////////////////////////////////////////////// +/// @brief deadlock detector +/// +/// @file +/// +/// DISCLAIMER +/// +/// Copyright 2014 ArangoDB GmbH, Cologne, Germany +/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany +/// +/// Licensed under the Apache License, Version 2.0 (the "License"); +/// you may not use this file except in compliance with the License. +/// You may obtain a copy of the License at +/// +/// http://www.apache.org/licenses/LICENSE-2.0 +/// +/// Unless required by applicable law or agreed to in writing, software +/// distributed under the License is distributed on an "AS IS" BASIS, +/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +/// See the License for the specific language governing permissions and +/// limitations under the License. +/// +/// Copyright holder is ArangoDB GmbH, Cologne, Germany +/// +/// @author Jan Steemann +/// @author Copyright 2014, ArangoDB GmbH, Cologne, Germany +/// @author Copyright 2013-2013, triAGENS GmbH, Cologne, Germany +//////////////////////////////////////////////////////////////////////////////// + +#ifndef ARANGODB_BASICS_DEADLOCK_DETECTOR_H +#define ARANGODB_BASICS_DEADLOCK_DETECTOR_H 1 + +#include "Basics/Common.h" +#include "Basics/Mutex.h" +#include "Basics/MutexLocker.h" +#include "Basics/threads.h" + +namespace triagens { + namespace basics { + +// ----------------------------------------------------------------------------- +// --SECTION-- DeadlockDetector +// ----------------------------------------------------------------------------- + + template + class DeadlockDetector { + +// ----------------------------------------------------------------------------- +// --SECTION-- constructors / destructors +// ----------------------------------------------------------------------------- + + public: + + DeadlockDetector () = default; + ~DeadlockDetector () = default; + + DeadlockDetector (DeadlockDetector const&) = delete; + DeadlockDetector& operator= (DeadlockDetector const&) = delete; + +// ----------------------------------------------------------------------------- +// --SECTION-- public functions +// ----------------------------------------------------------------------------- + + public: + + bool isDeadlocked (T const* value) { + auto tid = TRI_CurrentThreadId(); + std::unordered_set watchFor({ tid }); + + std::vector stack; + + TRI_tid_t writerTid; + + { + MUTEX_LOCKER(_writersLock); + // find responsible writer + auto it = _writers.find(value); + + if (it == _writers.end()) { + return false; + } + + writerTid = (*it).second; + } + + stack.push_back(writerTid); + + MUTEX_LOCKER(_readersLock); + + while (! stack.empty()) { + TRI_tid_t current = stack.back(); + stack.pop_back(); + + watchFor.emplace(current); + auto it2 = _readersBlocked.find(current); + + if (it2 == _readersBlocked.end()) { + return false; + } + + if (watchFor.find((*it2).second) != watchFor.end()) { + // deadlock! + return true; + } + + stack.push_back((*it2).second); + } + + // no deadlock found + return false; + } + +//////////////////////////////////////////////////////////////////////////////// +/// @brief insert a reader into the list of blocked readers +/// returns true if a deadlock was detected and false otherwise +//////////////////////////////////////////////////////////////////////////////// + + bool setReaderBlocked (T const* value) { + auto tid = TRI_CurrentThreadId(); + std::unordered_set watchFor({ tid }); + + std::vector stack; + + TRI_tid_t writerTid; + + { + MUTEX_LOCKER(_writersLock); + // find responsible writer + auto it = _writers.find(value); + + if (it == _writers.end()) { + return false; + } + + writerTid = (*it).second; + } + + stack.push_back(writerTid); + + MUTEX_LOCKER(_readersLock); + _readersBlocked.emplace(tid, writerTid); + + try { + while (! stack.empty()) { + TRI_tid_t current = stack.back(); + stack.pop_back(); + + watchFor.emplace(current); + auto it2 = _readersBlocked.find(current); + + if (it2 == _readersBlocked.end()) { + return false; + } + + if (watchFor.find((*it2).second) != watchFor.end()) { + // deadlock! + _readersBlocked.erase(tid); + return true; + } + + stack.push_back((*it2).second); + } + + // no deadlock found + return false; + } + catch (...) { + // clean up and re-throw + _readersBlocked.erase(tid); + throw; + } + } + +//////////////////////////////////////////////////////////////////////////////// +/// @brief remove a reader from the list of blocked readers +//////////////////////////////////////////////////////////////////////////////// + + void setReaderUnblocked (T const* value) noexcept { + auto tid = TRI_CurrentThreadId(); + + try { + MUTEX_LOCKER(_readersLock); + _readersBlocked.erase(tid); + } + catch (...) { + } + } + +//////////////////////////////////////////////////////////////////////////////// +/// @brief inserts a writer into the list of writers +//////////////////////////////////////////////////////////////////////////////// + + void setWriterStarted (T const* value) { + auto tid = TRI_CurrentThreadId(); + + MUTEX_LOCKER(_writersLock); + _writers.emplace(value, tid); + } + +//////////////////////////////////////////////////////////////////////////////// +/// @brief removes a writers from the list of writers +//////////////////////////////////////////////////////////////////////////////// + + void setWriterFinished (T const* value) noexcept { + try { + MUTEX_LOCKER(_writersLock); + _writers.erase(value); + } + catch (...) { + } + } + +// ----------------------------------------------------------------------------- +// --SECTION-- private variables +// ----------------------------------------------------------------------------- + + private: + +//////////////////////////////////////////////////////////////////////////////// +/// @brief lock for managing the writers +//////////////////////////////////////////////////////////////////////////////// + + triagens::basics::Mutex _writersLock; + +//////////////////////////////////////////////////////////////////////////////// +/// @brief all operating writers +//////////////////////////////////////////////////////////////////////////////// + + std::unordered_map _writers; + +//////////////////////////////////////////////////////////////////////////////// +/// @brief lock for managing the readers +//////////////////////////////////////////////////////////////////////////////// + + triagens::basics::Mutex _readersLock; + +//////////////////////////////////////////////////////////////////////////////// +/// @brief readers that are blocked on writers +//////////////////////////////////////////////////////////////////////////////// + + std::unordered_map _readersBlocked; + + }; + + } // namespace triagens::basics +} // namespace triagens + +#endif + +// ----------------------------------------------------------------------------- +// --SECTION-- END-OF-FILE +// ----------------------------------------------------------------------------- + +// Local Variables: +// mode: outline-minor +// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @page\\|// --SECTION--\\|/// @\\}" +// End: diff --git a/lib/Basics/errors.dat b/lib/Basics/errors.dat index 6e4106a46d..920c9255fd 100755 --- a/lib/Basics/errors.dat +++ b/lib/Basics/errors.dat @@ -31,6 +31,7 @@ ERROR_IP_ADDRESS_INVALID,25,"IP address is invalid","Will be raised when the str ERROR_LEGEND_NOT_IN_WAL_FILE,26,"internal error if a legend for a marker does not yet exist in the same WAL file","Will be raised internally, then fixed internally, and never come out to the user." ERROR_FILE_EXISTS,27,"file exists","Will be raised when a file already exists." ERROR_LOCKED,28,"locked","Will be raised when a resource or an operation is locked." +ERROR_DEADLOCK,29,"deadlock detected","Will be raised when a deadlock is detected when accessing collections." ################################################################################ ## HTTP standard errors diff --git a/lib/Basics/voc-errors.cpp b/lib/Basics/voc-errors.cpp index eb180e0af6..49b1bb8d54 100644 --- a/lib/Basics/voc-errors.cpp +++ b/lib/Basics/voc-errors.cpp @@ -35,6 +35,7 @@ void TRI_InitializeErrorMessages () { REG_ERROR(ERROR_LEGEND_NOT_IN_WAL_FILE, "internal error if a legend for a marker does not yet exist in the same WAL file"); REG_ERROR(ERROR_FILE_EXISTS, "file exists"); REG_ERROR(ERROR_LOCKED, "locked"); + REG_ERROR(ERROR_DEADLOCK, "deadlock detected"); REG_ERROR(ERROR_HTTP_BAD_PARAMETER, "bad parameter"); REG_ERROR(ERROR_HTTP_UNAUTHORIZED, "unauthorized"); REG_ERROR(ERROR_HTTP_FORBIDDEN, "forbidden"); diff --git a/lib/Basics/voc-errors.h b/lib/Basics/voc-errors.h index 21b7436e52..23c35fe070 100644 --- a/lib/Basics/voc-errors.h +++ b/lib/Basics/voc-errors.h @@ -68,6 +68,8 @@ /// Will be raised when a file already exists. /// - 28: @LIT{locked} /// Will be raised when a resource or an operation is locked. +/// - 29: @LIT{deadlock detected} +/// Will be raised when a deadlock is detected when accessing collections. /// - 400: @LIT{bad parameter} /// Will be raised when the HTTP request does not fulfill the requirements. /// - 401: @LIT{unauthorized} @@ -966,6 +968,16 @@ void TRI_InitializeErrorMessages (); #define TRI_ERROR_LOCKED (28) +//////////////////////////////////////////////////////////////////////////////// +/// @brief 29: ERROR_DEADLOCK +/// +/// deadlock detected +/// +/// Will be raised when a deadlock is detected when accessing collections. +//////////////////////////////////////////////////////////////////////////////// + +#define TRI_ERROR_DEADLOCK (29) + //////////////////////////////////////////////////////////////////////////////// /// @brief 400: ERROR_HTTP_BAD_PARAMETER /// From 3e9083f1495ea63327096831033f8f3b14790621 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Thu, 29 Oct 2015 12:53:04 +0100 Subject: [PATCH 03/25] Updated V8 --- LICENSES-OTHER-COMPONENTS.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/LICENSES-OTHER-COMPONENTS.md b/LICENSES-OTHER-COMPONENTS.md index 08f82d06f6..b29a22aa24 100644 --- a/LICENSES-OTHER-COMPONENTS.md +++ b/LICENSES-OTHER-COMPONENTS.md @@ -5,7 +5,10 @@ ### Google V8 * https://code.google.com/p/v8/ -* [BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause) +* [overview](https://github.com/arangodb/arangodb/blob/devel/3rdParty/V8-4.3.61/LICENSE) +* [V8](https://github.com/arangodb/arangodb/blob/devel/3rdParty/V8-4.3.61/LICENSE.v8) +* [strongtalk](https://github.com/arangodb/arangodb/blob/devel/3rdParty/V8-4.3.61/LICENSE.strongtalk) +* [valgrind](https://github.com/arangodb/arangodb/blob/devel/3rdParty/V8-4.3.61/LICENSE.valgrind) ### icu From c4ef29943d257433a9899731849c64e8edeb10e9 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Thu, 29 Oct 2015 13:06:52 +0100 Subject: [PATCH 04/25] added link for bison --- LICENSES-OTHER-COMPONENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSES-OTHER-COMPONENTS.md b/LICENSES-OTHER-COMPONENTS.md index b29a22aa24..45c513cc5b 100644 --- a/LICENSES-OTHER-COMPONENTS.md +++ b/LICENSES-OTHER-COMPONENTS.md @@ -61,7 +61,7 @@ ### Bison * https://www.gnu.org/software/bison/ -* only used to generate code, not part of the distribution +* only used to generate code, not part of the distribution; for details about using Bison in this way see http://www.gnu.org/software/bison/manual/bison.html#Conditions * parts generated use see https://github.com/arangodb/arangodb/blob/devel/arangod/Aql/grammar.cpp#L20 ### Flex From a5ee3564720884175566cf9c27142894295493b8 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Thu, 29 Oct 2015 13:31:42 +0100 Subject: [PATCH 05/25] V8 components --- LICENSES-OTHER-COMPONENTS.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/LICENSES-OTHER-COMPONENTS.md b/LICENSES-OTHER-COMPONENTS.md index 45c513cc5b..9e6ebbcd74 100644 --- a/LICENSES-OTHER-COMPONENTS.md +++ b/LICENSES-OTHER-COMPONENTS.md @@ -5,10 +5,7 @@ ### Google V8 * https://code.google.com/p/v8/ -* [overview](https://github.com/arangodb/arangodb/blob/devel/3rdParty/V8-4.3.61/LICENSE) -* [V8](https://github.com/arangodb/arangodb/blob/devel/3rdParty/V8-4.3.61/LICENSE.v8) -* [strongtalk](https://github.com/arangodb/arangodb/blob/devel/3rdParty/V8-4.3.61/LICENSE.strongtalk) -* [valgrind](https://github.com/arangodb/arangodb/blob/devel/3rdParty/V8-4.3.61/LICENSE.valgrind) +* [overview](https://github.com/v8/v8/blob/4.3.61/LICENSE), [V8](https://github.com/v8/v8/blob/4.3.61/LICENSE.v8), [strongtalk](https://github.com/v8/v8/blob/4.3.61/LICENSE.strongtalk), [valgrind](https://github.com/v8/v8/blob/4.3.61/LICENSE.valgrind), [vtune](https://github.com/v8/v8/blob/4.3.61/src/third_party/vtune/v8-vtune.h), [gmock](https://github.com/arangodb/arangodb/blob/devel/3rdParty/V8-4.3.61/testing/gmock/LICENSE), [fdlibm](https://raw.githubusercontent.com/v8/v8/4.3.61/src/third_party/fdlibm/LICENSE) ### icu @@ -134,7 +131,7 @@ * https://github.com/jshttp/http-errors * [MIT License](https://raw.githubusercontent.com/jshttp/http-errors/master/LICENSE) -#### i +#### inflect * https://github.com/pksunkara/inflect * [MIT License](https://raw.githubusercontent.com/pksunkara/inflect/master/LICENSE) From 3f538f4e5432b7fd9c1a94d75447e16e6ef9c6eb Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Thu, 29 Oct 2015 13:35:24 +0100 Subject: [PATCH 06/25] raw display --- LICENSES-OTHER-COMPONENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSES-OTHER-COMPONENTS.md b/LICENSES-OTHER-COMPONENTS.md index 9e6ebbcd74..d2f25be9c1 100644 --- a/LICENSES-OTHER-COMPONENTS.md +++ b/LICENSES-OTHER-COMPONENTS.md @@ -5,7 +5,7 @@ ### Google V8 * https://code.google.com/p/v8/ -* [overview](https://github.com/v8/v8/blob/4.3.61/LICENSE), [V8](https://github.com/v8/v8/blob/4.3.61/LICENSE.v8), [strongtalk](https://github.com/v8/v8/blob/4.3.61/LICENSE.strongtalk), [valgrind](https://github.com/v8/v8/blob/4.3.61/LICENSE.valgrind), [vtune](https://github.com/v8/v8/blob/4.3.61/src/third_party/vtune/v8-vtune.h), [gmock](https://github.com/arangodb/arangodb/blob/devel/3rdParty/V8-4.3.61/testing/gmock/LICENSE), [fdlibm](https://raw.githubusercontent.com/v8/v8/4.3.61/src/third_party/fdlibm/LICENSE) +* [overview](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE), [V8](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE.v8), [strongtalk](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE.strongtalk), [valgrind](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE.valgrind), [vtune](https://raw.githubusercontent.com/v8/v8/4.3.61/src/third_party/vtune/v8-vtune.h), [gmock](https://raw.githubusercontent.com/arangodb/arangodb/devel/3rdParty/V8-4.3.61/testing/gmock/LICENSE), [gtest](https://raw.githubusercontent.com/arangodb/arangodb/devel/3rdParty/V8-4.3.61/testing/gtest/LICENSE), [fdlibm](https://raw.githubusercontent.com/v8/v8/4.3.61/src/third_party/fdlibm/LICENSE) ### icu From 38d7680cc2cf82d767b3855056a7b87b233020ac Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Thu, 29 Oct 2015 13:41:46 +0100 Subject: [PATCH 07/25] pcre & object-keys license --- LICENSES-OTHER-COMPONENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSES-OTHER-COMPONENTS.md b/LICENSES-OTHER-COMPONENTS.md index d2f25be9c1..359c558bfc 100644 --- a/LICENSES-OTHER-COMPONENTS.md +++ b/LICENSES-OTHER-COMPONENTS.md @@ -5,7 +5,7 @@ ### Google V8 * https://code.google.com/p/v8/ -* [overview](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE), [V8](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE.v8), [strongtalk](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE.strongtalk), [valgrind](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE.valgrind), [vtune](https://raw.githubusercontent.com/v8/v8/4.3.61/src/third_party/vtune/v8-vtune.h), [gmock](https://raw.githubusercontent.com/arangodb/arangodb/devel/3rdParty/V8-4.3.61/testing/gmock/LICENSE), [gtest](https://raw.githubusercontent.com/arangodb/arangodb/devel/3rdParty/V8-4.3.61/testing/gtest/LICENSE), [fdlibm](https://raw.githubusercontent.com/v8/v8/4.3.61/src/third_party/fdlibm/LICENSE) +* [overview](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE), [V8](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE.v8), [strongtalk](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE.strongtalk), [valgrind](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE.valgrind), [vtune](https://raw.githubusercontent.com/v8/v8/4.3.61/src/third_party/vtune/v8-vtune.h), [gmock](https://raw.githubusercontent.com/arangodb/arangodb/devel/3rdParty/V8-4.3.61/testing/gmock/LICENSE), [gtest](https://raw.githubusercontent.com/arangodb/arangodb/devel/3rdParty/V8-4.3.61/testing/gtest/LICENSE), [fdlibm](https://raw.githubusercontent.com/v8/v8/4.3.61/src/third_party/fdlibm/LICENSE), [PCRE](https://raw.githubusercontent.com/v8/v8/master/test/mjsunit/third_party/regexp-pcre/LICENSE), [object-keys](https://raw.githubusercontent.com/v8/v8/master/test/mjsunit/third_party/object-keys/LICENSE) ### icu From fe7d3a4dc75b853a33ad70ef02bc16e50565bb82 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Thu, 29 Oct 2015 13:47:27 +0100 Subject: [PATCH 08/25] Update LICENSES-OTHER-COMPONENTS.md --- LICENSES-OTHER-COMPONENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSES-OTHER-COMPONENTS.md b/LICENSES-OTHER-COMPONENTS.md index 359c558bfc..6186b4664a 100644 --- a/LICENSES-OTHER-COMPONENTS.md +++ b/LICENSES-OTHER-COMPONENTS.md @@ -5,7 +5,7 @@ ### Google V8 * https://code.google.com/p/v8/ -* [overview](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE), [V8](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE.v8), [strongtalk](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE.strongtalk), [valgrind](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE.valgrind), [vtune](https://raw.githubusercontent.com/v8/v8/4.3.61/src/third_party/vtune/v8-vtune.h), [gmock](https://raw.githubusercontent.com/arangodb/arangodb/devel/3rdParty/V8-4.3.61/testing/gmock/LICENSE), [gtest](https://raw.githubusercontent.com/arangodb/arangodb/devel/3rdParty/V8-4.3.61/testing/gtest/LICENSE), [fdlibm](https://raw.githubusercontent.com/v8/v8/4.3.61/src/third_party/fdlibm/LICENSE), [PCRE](https://raw.githubusercontent.com/v8/v8/master/test/mjsunit/third_party/regexp-pcre/LICENSE), [object-keys](https://raw.githubusercontent.com/v8/v8/master/test/mjsunit/third_party/object-keys/LICENSE) +* License: [v8-overview](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE), [V8](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE.v8), [strongtalk](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE.strongtalk), [valgrind](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE.valgrind), [vtune](https://raw.githubusercontent.com/v8/v8/4.3.61/src/third_party/vtune/v8-vtune.h), [gmock](https://raw.githubusercontent.com/arangodb/arangodb/devel/3rdParty/V8-4.3.61/testing/gmock/LICENSE), [gtest](https://raw.githubusercontent.com/arangodb/arangodb/devel/3rdParty/V8-4.3.61/testing/gtest/LICENSE), [fdlibm](https://raw.githubusercontent.com/v8/v8/4.3.61/src/third_party/fdlibm/LICENSE), [PCRE](https://raw.githubusercontent.com/v8/v8/master/test/mjsunit/third_party/regexp-pcre/LICENSE), [object-keys](https://raw.githubusercontent.com/v8/v8/master/test/mjsunit/third_party/object-keys/LICENSE) ### icu From f2fcaa1466afceceb3870b24194d7cf6ec8adf64 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Thu, 29 Oct 2015 13:48:11 +0100 Subject: [PATCH 09/25] Update LICENSES-OTHER-COMPONENTS.md --- LICENSES-OTHER-COMPONENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSES-OTHER-COMPONENTS.md b/LICENSES-OTHER-COMPONENTS.md index 6186b4664a..f997957c4d 100644 --- a/LICENSES-OTHER-COMPONENTS.md +++ b/LICENSES-OTHER-COMPONENTS.md @@ -4,7 +4,7 @@ ### Google V8 -* https://code.google.com/p/v8/ +* Project Home: https://code.google.com/p/v8/ * License: [v8-overview](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE), [V8](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE.v8), [strongtalk](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE.strongtalk), [valgrind](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE.valgrind), [vtune](https://raw.githubusercontent.com/v8/v8/4.3.61/src/third_party/vtune/v8-vtune.h), [gmock](https://raw.githubusercontent.com/arangodb/arangodb/devel/3rdParty/V8-4.3.61/testing/gmock/LICENSE), [gtest](https://raw.githubusercontent.com/arangodb/arangodb/devel/3rdParty/V8-4.3.61/testing/gtest/LICENSE), [fdlibm](https://raw.githubusercontent.com/v8/v8/4.3.61/src/third_party/fdlibm/LICENSE), [PCRE](https://raw.githubusercontent.com/v8/v8/master/test/mjsunit/third_party/regexp-pcre/LICENSE), [object-keys](https://raw.githubusercontent.com/v8/v8/master/test/mjsunit/third_party/object-keys/LICENSE) ### icu From 1b104c2033d9214580277ab54a2b9d38cbf925d9 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Thu, 29 Oct 2015 13:50:07 +0100 Subject: [PATCH 10/25] Update LICENSES-OTHER-COMPONENTS.md --- LICENSES-OTHER-COMPONENTS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSES-OTHER-COMPONENTS.md b/LICENSES-OTHER-COMPONENTS.md index f997957c4d..19c3d0f130 100644 --- a/LICENSES-OTHER-COMPONENTS.md +++ b/LICENSES-OTHER-COMPONENTS.md @@ -2,12 +2,12 @@ ## C/C++ Libraries -### Google V8 +### Google V8 4.3.61 * Project Home: https://code.google.com/p/v8/ * License: [v8-overview](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE), [V8](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE.v8), [strongtalk](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE.strongtalk), [valgrind](https://raw.githubusercontent.com/v8/v8/4.3.61/LICENSE.valgrind), [vtune](https://raw.githubusercontent.com/v8/v8/4.3.61/src/third_party/vtune/v8-vtune.h), [gmock](https://raw.githubusercontent.com/arangodb/arangodb/devel/3rdParty/V8-4.3.61/testing/gmock/LICENSE), [gtest](https://raw.githubusercontent.com/arangodb/arangodb/devel/3rdParty/V8-4.3.61/testing/gtest/LICENSE), [fdlibm](https://raw.githubusercontent.com/v8/v8/4.3.61/src/third_party/fdlibm/LICENSE), [PCRE](https://raw.githubusercontent.com/v8/v8/master/test/mjsunit/third_party/regexp-pcre/LICENSE), [object-keys](https://raw.githubusercontent.com/v8/v8/master/test/mjsunit/third_party/object-keys/LICENSE) -### icu +### ICU 54.1 * http://site.icu-project.org/ * [ICU License](http://source.icu-project.org/repos/icu/icu/trunk/license.html) From 1ff5e172017a4e5c0f922a41179060a7d753f7ed Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Thu, 29 Oct 2015 13:50:44 +0100 Subject: [PATCH 11/25] Update LICENSES-OTHER-COMPONENTS.md --- LICENSES-OTHER-COMPONENTS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSES-OTHER-COMPONENTS.md b/LICENSES-OTHER-COMPONENTS.md index 19c3d0f130..3e0673f87c 100644 --- a/LICENSES-OTHER-COMPONENTS.md +++ b/LICENSES-OTHER-COMPONENTS.md @@ -9,8 +9,8 @@ ### ICU 54.1 -* http://site.icu-project.org/ -* [ICU License](http://source.icu-project.org/repos/icu/icu/trunk/license.html) +* Project Home: http://site.icu-project.org/ +* License: [ICU License](http://source.icu-project.org/repos/icu/icu/trunk/license.html) ### libev From 97d0c7573786d77be207e94905bac78a3cfaaf4e Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Thu, 29 Oct 2015 14:06:02 +0100 Subject: [PATCH 12/25] Update LICENSES-OTHER-COMPONENTS.md --- LICENSES-OTHER-COMPONENTS.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSES-OTHER-COMPONENTS.md b/LICENSES-OTHER-COMPONENTS.md index 3e0673f87c..951837b140 100644 --- a/LICENSES-OTHER-COMPONENTS.md +++ b/LICENSES-OTHER-COMPONENTS.md @@ -12,10 +12,10 @@ * Project Home: http://site.icu-project.org/ * License: [ICU License](http://source.icu-project.org/repos/icu/icu/trunk/license.html) -### libev +### libev 4.11 -* http://software.schmorp.de/pkg/libev.html -* [free as-is license](http://cvs.schmorp.de/libev/LICENSE?revision=1.11&view=markup) +* Project Home: http://software.schmorp.de/pkg/libev.html +* License: Dual-License, including [free as-is license](http://cvs.schmorp.de/libev/LICENSE?revision=1.11&view=markup) ### zlib From 75ce9be79f66c54e53a304ac8963597783921399 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Thu, 29 Oct 2015 14:08:02 +0100 Subject: [PATCH 13/25] Update LICENSES-OTHER-COMPONENTS.md --- LICENSES-OTHER-COMPONENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSES-OTHER-COMPONENTS.md b/LICENSES-OTHER-COMPONENTS.md index 951837b140..fa0fcc31f3 100644 --- a/LICENSES-OTHER-COMPONENTS.md +++ b/LICENSES-OTHER-COMPONENTS.md @@ -17,7 +17,7 @@ * Project Home: http://software.schmorp.de/pkg/libev.html * License: Dual-License, including [free as-is license](http://cvs.schmorp.de/libev/LICENSE?revision=1.11&view=markup) -### zlib +### zlib 1.2.7 * [free as-is license](https://github.com/arangodb/arangodb/blob/devel/3rdParty/zlib-1.2.7/README#L85) From 373e81c28e7eea13edb6ec11674be24c3774f126 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Thu, 29 Oct 2015 14:08:34 +0100 Subject: [PATCH 14/25] Update LICENSES-OTHER-COMPONENTS.md --- LICENSES-OTHER-COMPONENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSES-OTHER-COMPONENTS.md b/LICENSES-OTHER-COMPONENTS.md index fa0fcc31f3..45500abe34 100644 --- a/LICENSES-OTHER-COMPONENTS.md +++ b/LICENSES-OTHER-COMPONENTS.md @@ -19,7 +19,7 @@ ### zlib 1.2.7 -* [free as-is license](https://github.com/arangodb/arangodb/blob/devel/3rdParty/zlib-1.2.7/README#L85) +* License: [free as-is license](https://github.com/arangodb/arangodb/blob/devel/3rdParty/zlib-1.2.7/README#L85) ### Valgrind From 8d1c5c2764eed04a3dfab0ac40e41519dc891164 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Thu, 29 Oct 2015 14:11:57 +0100 Subject: [PATCH 15/25] Update LICENSES-OTHER-COMPONENTS.md --- LICENSES-OTHER-COMPONENTS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/LICENSES-OTHER-COMPONENTS.md b/LICENSES-OTHER-COMPONENTS.md index 45500abe34..f5076db4fd 100644 --- a/LICENSES-OTHER-COMPONENTS.md +++ b/LICENSES-OTHER-COMPONENTS.md @@ -23,8 +23,9 @@ ### Valgrind +* Project Home: http://valgrind.org/ * valgrind.h header file only -* [BSD-style license](https://github.com/arangodb/arangodb/blob/devel/3rdParty/valgrind/valgrind.h) +* License: [BSD-style license](https://raw.githubusercontent.com/arangodb/arangodb/devel/3rdParty/valgrind/valgrind.h) ### boost From c8993f3412edc30189afda162cf09f829257a241 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Thu, 29 Oct 2015 14:26:48 +0100 Subject: [PATCH 16/25] Update LICENSES-OTHER-COMPONENTS.md --- LICENSES-OTHER-COMPONENTS.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSES-OTHER-COMPONENTS.md b/LICENSES-OTHER-COMPONENTS.md index f5076db4fd..700dda7c99 100644 --- a/LICENSES-OTHER-COMPONENTS.md +++ b/LICENSES-OTHER-COMPONENTS.md @@ -27,10 +27,10 @@ * valgrind.h header file only * License: [BSD-style license](https://raw.githubusercontent.com/arangodb/arangodb/devel/3rdParty/valgrind/valgrind.h) -### boost +### Boost 1.58.0 -* http://www.boost.org/ -* [boost software license](http://www.boost.org/LICENSE_1_0.txt) +* Project Home: http://www.boost.org/ +* License: [boost software license](http://www.boost.org/LICENSE_1_0.txt), [free as-is license](https://raw.githubusercontent.com/arangodb/arangodb/devel/3rdParty/boost/1.58.0/boost/test/utils/runtime/cla/detail/argument_value_usage.hpp) ### linenoise From f4df8f909726c86c28863edb35317d859e18832e Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Thu, 29 Oct 2015 14:29:18 +0100 Subject: [PATCH 17/25] Update LICENSES-OTHER-COMPONENTS.md --- LICENSES-OTHER-COMPONENTS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSES-OTHER-COMPONENTS.md b/LICENSES-OTHER-COMPONENTS.md index 700dda7c99..e9b2cdf78d 100644 --- a/LICENSES-OTHER-COMPONENTS.md +++ b/LICENSES-OTHER-COMPONENTS.md @@ -34,8 +34,8 @@ ### linenoise -* https://github.com/antirez/linenoise -* [free as-is license](https://github.com/antirez/linenoise/blob/master/LICENSE) +* Project Home: https://github.com/antirez/linenoise +* License: [free as-is license](https://raw.githubusercontent.com/antirez/linenoise/master/LICENSE) ### fpconv_dtoa From b96c29204fb79d20da8c19dcb262abb96ebfc18f Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Thu, 29 Oct 2015 14:32:02 +0100 Subject: [PATCH 18/25] Update LICENSES-OTHER-COMPONENTS.md --- LICENSES-OTHER-COMPONENTS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSES-OTHER-COMPONENTS.md b/LICENSES-OTHER-COMPONENTS.md index e9b2cdf78d..6a06b70957 100644 --- a/LICENSES-OTHER-COMPONENTS.md +++ b/LICENSES-OTHER-COMPONENTS.md @@ -39,8 +39,8 @@ ### fpconv_dtoa -* https://github.com/night-shift/fpconv/ -* [MIT License](https://raw.githubusercontent.com/night-shift/fpconv/master/license) +* Project Home: https://github.com/night-shift/fpconv/ +* License: [MIT License](https://raw.githubusercontent.com/night-shift/fpconv/master/license) ## Programs From ac4069d9de7630139e42bac6bd744b285aa431b7 Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Thu, 29 Oct 2015 14:49:29 +0100 Subject: [PATCH 19/25] added TRI_DeleteArrayJson() function --- UnitTests/Basics/json-test.cpp | 76 ++++++++++++++++++++++++++++++++-- lib/Basics/json.cpp | 21 ++++++++++ lib/Basics/json.h | 8 ++++ 3 files changed, 102 insertions(+), 3 deletions(-) diff --git a/UnitTests/Basics/json-test.cpp b/UnitTests/Basics/json-test.cpp index 20ba89a902..0f1ad0ed9a 100644 --- a/UnitTests/Basics/json-test.cpp +++ b/UnitTests/Basics/json-test.cpp @@ -436,18 +436,88 @@ BOOST_AUTO_TEST_CASE (tst_json_string_utf8_3) { //////////////////////////////////////////////////////////////////////////////// /// @brief test empty json list //////////////////////////////////////////////////////////////////////////////// - + BOOST_AUTO_TEST_CASE (tst_json_list_empty) { INIT_BUFFER - + TRI_json_t* json = TRI_CreateArrayJson(TRI_UNKNOWN_MEM_ZONE); - + STRINGIFY BOOST_CHECK_EQUAL("[]", STRING_VALUE); FREE_JSON FREE_BUFFER } +//////////////////////////////////////////////////////////////////////////////// +/// @brief test remove from array +//////////////////////////////////////////////////////////////////////////////// + +BOOST_AUTO_TEST_CASE (tst_remove_from_array_empty) { + TRI_json_t* json = TRI_CreateArrayJson(TRI_UNKNOWN_MEM_ZONE); + + BOOST_CHECK_EQUAL(0ULL, TRI_LengthArrayJson(json)); + BOOST_CHECK_EQUAL(false, TRI_DeleteArrayJson(TRI_UNKNOWN_MEM_ZONE, json, 0)); + BOOST_CHECK_EQUAL(false, TRI_DeleteArrayJson(TRI_UNKNOWN_MEM_ZONE, json, 10)); + BOOST_CHECK_EQUAL(false, TRI_DeleteArrayJson(TRI_UNKNOWN_MEM_ZONE, json, 5)); + BOOST_CHECK_EQUAL(false, TRI_DeleteArrayJson(TRI_UNKNOWN_MEM_ZONE, json, 2)); + BOOST_CHECK_EQUAL(false, TRI_DeleteArrayJson(TRI_UNKNOWN_MEM_ZONE, json, 1)); + BOOST_CHECK_EQUAL(false, TRI_DeleteArrayJson(TRI_UNKNOWN_MEM_ZONE, json, 0)); + + FREE_JSON +} + +//////////////////////////////////////////////////////////////////////////////// +/// @brief test remove from array +//////////////////////////////////////////////////////////////////////////////// + +BOOST_AUTO_TEST_CASE (tst_remove_from_array_nonempty1) { + TRI_json_t* json = TRI_CreateArrayJson(TRI_UNKNOWN_MEM_ZONE); + TRI_PushBack3ArrayJson(TRI_UNKNOWN_MEM_ZONE, json, TRI_CreateNullJson(TRI_UNKNOWN_MEM_ZONE)); + TRI_PushBack3ArrayJson(TRI_UNKNOWN_MEM_ZONE, json, TRI_CreateNumberJson(TRI_UNKNOWN_MEM_ZONE, 3.5)); + + BOOST_CHECK_EQUAL(2ULL, TRI_LengthArrayJson(json)); + BOOST_CHECK_EQUAL(false, TRI_DeleteArrayJson(TRI_UNKNOWN_MEM_ZONE, json, 10)); + BOOST_CHECK_EQUAL(false, TRI_DeleteArrayJson(TRI_UNKNOWN_MEM_ZONE, json, 5)); + BOOST_CHECK_EQUAL(false, TRI_DeleteArrayJson(TRI_UNKNOWN_MEM_ZONE, json, 2)); + + BOOST_CHECK_EQUAL(true, TRI_DeleteArrayJson(TRI_UNKNOWN_MEM_ZONE, json, 1)); + BOOST_CHECK_EQUAL(static_cast(0), TRI_LookupArrayJson(json, 1)); + BOOST_CHECK_EQUAL(1ULL, TRI_LengthArrayJson(json)); + BOOST_CHECK_EQUAL(true, TRI_IsNullJson(TRI_LookupArrayJson(json, 0))); + + BOOST_CHECK_EQUAL(true, TRI_DeleteArrayJson(TRI_UNKNOWN_MEM_ZONE, json, 0)); + BOOST_CHECK_EQUAL(0ULL, TRI_LengthArrayJson(json)); + BOOST_CHECK_EQUAL(static_cast(0), TRI_LookupArrayJson(json, 0)); + + FREE_JSON +} + +//////////////////////////////////////////////////////////////////////////////// +/// @brief test remove from array +//////////////////////////////////////////////////////////////////////////////// + +BOOST_AUTO_TEST_CASE (tst_remove_from_array_nonempty2) { + TRI_json_t* json = TRI_CreateArrayJson(TRI_UNKNOWN_MEM_ZONE); + TRI_PushBack3ArrayJson(TRI_UNKNOWN_MEM_ZONE, json, TRI_CreateNullJson(TRI_UNKNOWN_MEM_ZONE)); + TRI_PushBack3ArrayJson(TRI_UNKNOWN_MEM_ZONE, json, TRI_CreateNumberJson(TRI_UNKNOWN_MEM_ZONE, 3.5)); + + BOOST_CHECK_EQUAL(2ULL, TRI_LengthArrayJson(json)); + BOOST_CHECK_EQUAL(false, TRI_DeleteArrayJson(TRI_UNKNOWN_MEM_ZONE, json, 10)); + BOOST_CHECK_EQUAL(false, TRI_DeleteArrayJson(TRI_UNKNOWN_MEM_ZONE, json, 5)); + BOOST_CHECK_EQUAL(false, TRI_DeleteArrayJson(TRI_UNKNOWN_MEM_ZONE, json, 2)); + + BOOST_CHECK_EQUAL(true, TRI_DeleteArrayJson(TRI_UNKNOWN_MEM_ZONE, json, 0)); + BOOST_CHECK_EQUAL(1ULL, TRI_LengthArrayJson(json)); + BOOST_CHECK_EQUAL(static_cast(0), TRI_LookupArrayJson(json, 1)); + BOOST_CHECK_EQUAL(true, TRI_IsNumberJson(TRI_LookupArrayJson(json, 0))); + + BOOST_CHECK_EQUAL(true, TRI_DeleteArrayJson(TRI_UNKNOWN_MEM_ZONE, json, 0)); + BOOST_CHECK_EQUAL(0ULL, TRI_LengthArrayJson(json)); + BOOST_CHECK_EQUAL(static_cast(0), TRI_LookupArrayJson(json, 0)); + + FREE_JSON +} + //////////////////////////////////////////////////////////////////////////////// /// @brief test json list mixed //////////////////////////////////////////////////////////////////////////////// diff --git a/lib/Basics/json.cpp b/lib/Basics/json.cpp index 564d928b38..afc6320aca 100644 --- a/lib/Basics/json.cpp +++ b/lib/Basics/json.cpp @@ -669,6 +669,27 @@ TRI_json_t* TRI_LookupArrayJson (TRI_json_t const* array, size_t pos) { return static_cast(TRI_AtVector(&array->_value._objects, pos)); } +//////////////////////////////////////////////////////////////////////////////// +/// @brief deletes an element from a json array +//////////////////////////////////////////////////////////////////////////////// + +bool TRI_DeleteArrayJson (TRI_memory_zone_t* zone, TRI_json_t* array, size_t index) { + TRI_ASSERT(TRI_IsArrayJson(array)); + + size_t const n = TRI_LengthArrayJson(array); + + if (index >= n) { + return false; + } + + TRI_json_t* element = static_cast(TRI_AtVector(&array->_value._objects, index)); + TRI_ASSERT(element != nullptr); + TRI_DestroyJson(zone, element); + TRI_RemoveVector(&array->_value._objects, index); + + return true; +} + //////////////////////////////////////////////////////////////////////////////// /// @brief adds a new attribute to an object, using copy //////////////////////////////////////////////////////////////////////////////// diff --git a/lib/Basics/json.h b/lib/Basics/json.h index 5e8e607273..39f8e08c9a 100644 --- a/lib/Basics/json.h +++ b/lib/Basics/json.h @@ -292,6 +292,14 @@ int TRI_PushBack3ArrayJson (TRI_memory_zone_t*, TRI_json_t* TRI_LookupArrayJson (TRI_json_t const*, size_t); +//////////////////////////////////////////////////////////////////////////////// +/// @brief deletes an element from a json array +//////////////////////////////////////////////////////////////////////////////// + +bool TRI_DeleteArrayJson (TRI_memory_zone_t* zone, + TRI_json_t* object, + size_t index); + //////////////////////////////////////////////////////////////////////////////// /// @brief adds a new attribute to an object, using copy //////////////////////////////////////////////////////////////////////////////// From d70291425932d2e2e63a7fdcb1795f6a24403fc3 Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Thu, 29 Oct 2015 14:49:43 +0100 Subject: [PATCH 20/25] fixed memory errors in test code --- UnitTests/Basics/priorityqueue-test.cpp | 24 ++++++++++++++++-------- UnitTests/Basics/string-buffer-test.cpp | 8 +------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/UnitTests/Basics/priorityqueue-test.cpp b/UnitTests/Basics/priorityqueue-test.cpp index 860a9c5b73..b057a41b3c 100644 --- a/UnitTests/Basics/priorityqueue-test.cpp +++ b/UnitTests/Basics/priorityqueue-test.cpp @@ -83,6 +83,7 @@ BOOST_AUTO_TEST_CASE (tst_deque_case) { BOOST_CHECK_EQUAL(true, pq.empty()); bool b; + MyValue* v; b = pq.insert("a", new MyValue("a", 1)); BOOST_CHECK_EQUAL(b, true); @@ -92,8 +93,10 @@ BOOST_AUTO_TEST_CASE (tst_deque_case) { BOOST_CHECK_EQUAL(b, true); b = pq.insert("d", new MyValue("d", 4)); BOOST_CHECK_EQUAL(b, true); - b = pq.insert("c", new MyValue("c", 5)); + v = new MyValue("c", 5); + b = pq.insert("c", v); BOOST_CHECK_EQUAL(b, false); + delete v; BOOST_CHECK_EQUAL(4, (int) pq.size()); BOOST_CHECK_EQUAL(false, pq.empty()); @@ -112,7 +115,6 @@ BOOST_AUTO_TEST_CASE (tst_deque_case) { BOOST_CHECK(p == nullptr); std::string k; - MyValue* v; p = pq.getMinimal(); BOOST_CHECK_EQUAL(p->_key, "a"); @@ -173,6 +175,7 @@ BOOST_AUTO_TEST_CASE (tst_heap_case) { BOOST_CHECK_EQUAL(true, pq.empty()); bool b; + MyValue* v; b = pq.insert("a", new MyValue("a", 4)); BOOST_CHECK_EQUAL(b, true); @@ -182,8 +185,10 @@ BOOST_AUTO_TEST_CASE (tst_heap_case) { BOOST_CHECK_EQUAL(b, true); b = pq.insert("d", new MyValue("d", 2)); BOOST_CHECK_EQUAL(b, true); - b = pq.insert("c", new MyValue("c", 5)); + v = new MyValue("c", 5); + b = pq.insert("c", v); BOOST_CHECK_EQUAL(b, false); + delete v; BOOST_CHECK_EQUAL(4, (int) pq.size()); BOOST_CHECK_EQUAL(false, pq.empty()); @@ -202,7 +207,6 @@ BOOST_AUTO_TEST_CASE (tst_heap_case) { BOOST_CHECK(p == nullptr); std::string k; - MyValue* v; p = pq.getMinimal(); BOOST_CHECK_EQUAL(p->_key, "b"); @@ -263,6 +267,7 @@ BOOST_AUTO_TEST_CASE (tst_deque_case_with_lowering) { BOOST_CHECK_EQUAL(true, pq.empty()); bool b; + MyValue* v; b = pq.insert("a", new MyValue("a", 1)); BOOST_CHECK_EQUAL(b, true); @@ -272,8 +277,10 @@ BOOST_AUTO_TEST_CASE (tst_deque_case_with_lowering) { BOOST_CHECK_EQUAL(b, true); b = pq.insert("d", new MyValue("d", 4)); BOOST_CHECK_EQUAL(b, true); - b = pq.insert("c", new MyValue("c", 5)); + v = new MyValue("c", 5); + b = pq.insert("c", v); BOOST_CHECK_EQUAL(b, false); + delete v; BOOST_CHECK_EQUAL(4, (int) pq.size()); BOOST_CHECK_EQUAL(false, pq.empty()); @@ -294,7 +301,6 @@ BOOST_AUTO_TEST_CASE (tst_deque_case_with_lowering) { BOOST_CHECK(p == nullptr); std::string k; - MyValue* v; p = pq.getMinimal(); BOOST_CHECK_EQUAL(p->_key, "a"); @@ -355,6 +361,7 @@ BOOST_AUTO_TEST_CASE (tst_heap_case_with_lowering) { BOOST_CHECK_EQUAL(true, pq.empty()); bool b; + MyValue* v; b = pq.insert("a", new MyValue("a", 4)); BOOST_CHECK_EQUAL(b, true); @@ -364,8 +371,10 @@ BOOST_AUTO_TEST_CASE (tst_heap_case_with_lowering) { BOOST_CHECK_EQUAL(b, true); b = pq.insert("d", new MyValue("d", 3)); BOOST_CHECK_EQUAL(b, true); - b = pq.insert("c", new MyValue("c", 5)); + v = new MyValue("c", 5); + b = pq.insert("c", v); BOOST_CHECK_EQUAL(b, false); + delete v; BOOST_CHECK_EQUAL(4, (int) pq.size()); BOOST_CHECK_EQUAL(false, pq.empty()); @@ -386,7 +395,6 @@ BOOST_AUTO_TEST_CASE (tst_heap_case_with_lowering) { BOOST_CHECK(p == nullptr); std::string k; - MyValue* v; p = pq.getMinimal(); BOOST_CHECK_EQUAL(p->_key, "a"); diff --git a/UnitTests/Basics/string-buffer-test.cpp b/UnitTests/Basics/string-buffer-test.cpp index b36bf9b338..f7a1a0e1d5 100644 --- a/UnitTests/Basics/string-buffer-test.cpp +++ b/UnitTests/Basics/string-buffer-test.cpp @@ -480,8 +480,6 @@ BOOST_AUTO_TEST_CASE (tst_clear) { const char* ptr = TRI_BeginStringBuffer(&sb); TRI_ClearStringBuffer(&sb); BOOST_CHECK_EQUAL(0, (int) TRI_LengthStringBuffer(&sb)); - // clang 5.1 failes without the cast - BOOST_CHECK_EQUAL((unsigned int) '\0', (unsigned int) TRI_LastCharStringBuffer(&sb)); // buffer should still point to ptr BOOST_CHECK_EQUAL((void*) ptr, (void*) TRI_BeginStringBuffer(&sb)); @@ -531,9 +529,6 @@ BOOST_AUTO_TEST_CASE (tst_last_char) { TRI_InitStringBuffer(&sb, TRI_CORE_MEM_ZONE); - // clang 5.1 failes without the cast - BOOST_CHECK_EQUAL((unsigned int) '\0', (unsigned int) TRI_LastCharStringBuffer(&sb)); - TRI_AppendStringStringBuffer(&sb, "f"); BOOST_CHECK_EQUAL((unsigned int) 'f', (unsigned int) TRI_LastCharStringBuffer(&sb)); @@ -544,7 +539,7 @@ BOOST_AUTO_TEST_CASE (tst_last_char) { BOOST_CHECK_EQUAL((unsigned int) '\n', (unsigned int) TRI_LastCharStringBuffer(&sb)); TRI_ClearStringBuffer(&sb); - BOOST_CHECK_EQUAL((unsigned int) '\0', (unsigned int) TRI_LastCharStringBuffer(&sb)); + BOOST_CHECK_EQUAL(0, (int) TRI_LengthStringBuffer(&sb)); for (size_t i = 0; i < 100; ++i) { TRI_AppendStringStringBuffer(&sb, "the quick brown fox jumped over the lazy dog"); @@ -554,7 +549,6 @@ BOOST_AUTO_TEST_CASE (tst_last_char) { BOOST_CHECK_EQUAL((unsigned int) '.', (unsigned int) TRI_LastCharStringBuffer(&sb)); TRI_AnnihilateStringBuffer(&sb); - BOOST_CHECK_EQUAL((unsigned int) '\0', (unsigned int) TRI_LastCharStringBuffer(&sb)); TRI_DestroyStringBuffer(&sb); } From 4c421ea7cfeb5cfebec8cd23f49abad776b7ceaa Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Thu, 29 Oct 2015 14:56:02 +0100 Subject: [PATCH 21/25] Update LICENSES-OTHER-COMPONENTS.md --- LICENSES-OTHER-COMPONENTS.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/LICENSES-OTHER-COMPONENTS.md b/LICENSES-OTHER-COMPONENTS.md index 6a06b70957..8c19086ac0 100644 --- a/LICENSES-OTHER-COMPONENTS.md +++ b/LICENSES-OTHER-COMPONENTS.md @@ -46,21 +46,20 @@ ### CoreOS etcd -* https://coreos.com/using-coreos/etcd/ -* [Apache 2 License](https://github.com/coreos/etcd/blob/master/LICENSE) +* Project Home: https://coreos.com/using-coreos/etcd/ +* License: [Apache 2 License](https://github.com/coreos/etcd/blob/master/LICENSE) ### autotools -* http://www.gnu.org/software/autoconf/autoconf.html -* https://www.gnu.org/software/automake/ +* Project Home: http://www.gnu.org/software/autoconf/autoconf.html, https://www.gnu.org/software/automake/ * only used to generate code, not part of the distribution -* parts generated are free as-is license +* License: [configure](https://github.com/arangodb/arangodb/blob/master/configure#L11), [Makefile.in](https://raw.githubusercontent.com/arangodb/arangodb/master/Makefile.in), [ax_cxx_compile_stdcxx_11.m4](https://github.com/arangodb/arangodb/blob/master/m4/ax_cxx_compile_stdcxx_11.m4#L25) ### Bison -* https://www.gnu.org/software/bison/ +* Project Home: https://www.gnu.org/software/bison/ * only used to generate code, not part of the distribution; for details about using Bison in this way see http://www.gnu.org/software/bison/manual/bison.html#Conditions -* parts generated use see https://github.com/arangodb/arangodb/blob/devel/arangod/Aql/grammar.cpp#L20 +* License: (grammar.cpp)[https://github.com/arangodb/arangodb/blob/devel/arangod/Aql/grammar.cpp#L20] ### Flex From 4015382ecea3a45f8103274fe0cf76e3464ed13c Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Thu, 29 Oct 2015 15:01:53 +0100 Subject: [PATCH 22/25] Update LICENSES-OTHER-COMPONENTS.md --- LICENSES-OTHER-COMPONENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSES-OTHER-COMPONENTS.md b/LICENSES-OTHER-COMPONENTS.md index 8c19086ac0..b7aac9fecb 100644 --- a/LICENSES-OTHER-COMPONENTS.md +++ b/LICENSES-OTHER-COMPONENTS.md @@ -59,7 +59,7 @@ * Project Home: https://www.gnu.org/software/bison/ * only used to generate code, not part of the distribution; for details about using Bison in this way see http://www.gnu.org/software/bison/manual/bison.html#Conditions -* License: (grammar.cpp)[https://github.com/arangodb/arangodb/blob/devel/arangod/Aql/grammar.cpp#L20] +* License: [grammar.cpp](https://github.com/arangodb/arangodb/blob/devel/arangod/Aql/grammar.cpp#L20) ### Flex From 58e81c03b544454645e6765e2fa723c3ad9db638 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Thu, 29 Oct 2015 15:02:40 +0100 Subject: [PATCH 23/25] Update LICENSES-OTHER-COMPONENTS.md --- LICENSES-OTHER-COMPONENTS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSES-OTHER-COMPONENTS.md b/LICENSES-OTHER-COMPONENTS.md index b7aac9fecb..87dc98e4a9 100644 --- a/LICENSES-OTHER-COMPONENTS.md +++ b/LICENSES-OTHER-COMPONENTS.md @@ -55,13 +55,13 @@ * only used to generate code, not part of the distribution * License: [configure](https://github.com/arangodb/arangodb/blob/master/configure#L11), [Makefile.in](https://raw.githubusercontent.com/arangodb/arangodb/master/Makefile.in), [ax_cxx_compile_stdcxx_11.m4](https://github.com/arangodb/arangodb/blob/master/m4/ax_cxx_compile_stdcxx_11.m4#L25) -### Bison +### Bison 3.0 * Project Home: https://www.gnu.org/software/bison/ * only used to generate code, not part of the distribution; for details about using Bison in this way see http://www.gnu.org/software/bison/manual/bison.html#Conditions * License: [grammar.cpp](https://github.com/arangodb/arangodb/blob/devel/arangod/Aql/grammar.cpp#L20) -### Flex +### Flex 2.5 * http://flex.sourceforge.net/ * only used to generate code, not part of the distribution From 6297bc2ea9c9205d1252d1e1727beef9e5a37f40 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Thu, 29 Oct 2015 15:20:31 +0100 Subject: [PATCH 24/25] Update LICENSES-OTHER-COMPONENTS.md --- LICENSES-OTHER-COMPONENTS.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/LICENSES-OTHER-COMPONENTS.md b/LICENSES-OTHER-COMPONENTS.md index 87dc98e4a9..e8d38f5589 100644 --- a/LICENSES-OTHER-COMPONENTS.md +++ b/LICENSES-OTHER-COMPONENTS.md @@ -63,16 +63,16 @@ ### Flex 2.5 -* http://flex.sourceforge.net/ +* Project Home: http://flex.sourceforge.net/ * only used to generate code, not part of the distribution -* [free as-is license](http://flex.sourceforge.net/manual/Copyright.html#Copyright) +* License: [free as-is license](http://flex.sourceforge.net/manual/Copyright.html#Copyright) ## Javascript, Node and NPM ### Node core modules -* http://nodejs.org -* [MIT License](https://raw.githubusercontent.com/joyent/node/v0.10.33/LICENSE) +* Project Home: http://nodejs.org +* License: Node MIT License [_stream_duplex.js,_stream_passthrough.js,_stream_readable.js,_stream_transform.js,_stream_writable.js,events.js,querystring.js,stream.js,string_decoder.js,url.js](https://raw.githubusercontent.com/joyent/node/v0.10.33/LICENSE), MIT [punycode.js](https://raw.githubusercontent.com/joyent/node/v0.10.33/LICENSE) ### Bundled NPM modules From ec5f3ac5ab467ff13d3f053e46edc097ae6c56e6 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Thu, 29 Oct 2015 15:38:35 +0100 Subject: [PATCH 25/25] Update LICENSES-OTHER-COMPONENTS.md --- LICENSES-OTHER-COMPONENTS.md | 206 ++++++++++++++++++----------------- 1 file changed, 106 insertions(+), 100 deletions(-) diff --git a/LICENSES-OTHER-COMPONENTS.md b/LICENSES-OTHER-COMPONENTS.md index e8d38f5589..0afeccd958 100644 --- a/LICENSES-OTHER-COMPONENTS.md +++ b/LICENSES-OTHER-COMPONENTS.md @@ -2,6 +2,11 @@ ## C/C++ Libraries +### Boost 1.58.0 + +* Project Home: http://www.boost.org/ +* License: [boost software license](http://www.boost.org/LICENSE_1_0.txt), [free as-is license](https://raw.githubusercontent.com/arangodb/arangodb/devel/3rdParty/boost/1.58.0/boost/test/utils/runtime/cla/detail/argument_value_usage.hpp) + ### Google V8 4.3.61 * Project Home: https://code.google.com/p/v8/ @@ -12,14 +17,20 @@ * Project Home: http://site.icu-project.org/ * License: [ICU License](http://source.icu-project.org/repos/icu/icu/trunk/license.html) +### fpconv_dtoa + +* Project Home: https://github.com/night-shift/fpconv/ +* License: [MIT License](https://raw.githubusercontent.com/night-shift/fpconv/master/license) + ### libev 4.11 * Project Home: http://software.schmorp.de/pkg/libev.html * License: Dual-License, including [free as-is license](http://cvs.schmorp.de/libev/LICENSE?revision=1.11&view=markup) -### zlib 1.2.7 +### linenoise -* License: [free as-is license](https://github.com/arangodb/arangodb/blob/devel/3rdParty/zlib-1.2.7/README#L85) +* Project Home: https://github.com/antirez/linenoise +* License: [free as-is license](https://raw.githubusercontent.com/antirez/linenoise/master/LICENSE) ### Valgrind @@ -27,33 +38,23 @@ * valgrind.h header file only * License: [BSD-style license](https://raw.githubusercontent.com/arangodb/arangodb/devel/3rdParty/valgrind/valgrind.h) -### Boost 1.58.0 +### zlib 1.2.7 -* Project Home: http://www.boost.org/ -* License: [boost software license](http://www.boost.org/LICENSE_1_0.txt), [free as-is license](https://raw.githubusercontent.com/arangodb/arangodb/devel/3rdParty/boost/1.58.0/boost/test/utils/runtime/cla/detail/argument_value_usage.hpp) - -### linenoise - -* Project Home: https://github.com/antirez/linenoise -* License: [free as-is license](https://raw.githubusercontent.com/antirez/linenoise/master/LICENSE) - -### fpconv_dtoa - -* Project Home: https://github.com/night-shift/fpconv/ -* License: [MIT License](https://raw.githubusercontent.com/night-shift/fpconv/master/license) +* License: [free as-is license](https://github.com/arangodb/arangodb/blob/devel/3rdParty/zlib-1.2.7/README#L85) ## Programs -### CoreOS etcd +### autoconf -* Project Home: https://coreos.com/using-coreos/etcd/ -* License: [Apache 2 License](https://github.com/coreos/etcd/blob/master/LICENSE) - -### autotools - -* Project Home: http://www.gnu.org/software/autoconf/autoconf.html, https://www.gnu.org/software/automake/ +* Project Home: http://www.gnu.org/software/autoconf/autoconf.html * only used to generate code, not part of the distribution -* License: [configure](https://github.com/arangodb/arangodb/blob/master/configure#L11), [Makefile.in](https://raw.githubusercontent.com/arangodb/arangodb/master/Makefile.in), [ax_cxx_compile_stdcxx_11.m4](https://github.com/arangodb/arangodb/blob/master/m4/ax_cxx_compile_stdcxx_11.m4#L25) +* License: [configure](https://github.com/arangodb/arangodb/blob/master/configure#L11) [ax_cxx_compile_stdcxx_11.m4](https://github.com/arangodb/arangodb/blob/master/m4/ax_cxx_compile_stdcxx_11.m4#L25) + +### automake + +* Project https://www.gnu.org/software/automake/ +* only used to generate code, not part of the distribution +* License: [Makefile.in](https://raw.githubusercontent.com/arangodb/arangodb/master/Makefile.in) ### Bison 3.0 @@ -61,13 +62,18 @@ * only used to generate code, not part of the distribution; for details about using Bison in this way see http://www.gnu.org/software/bison/manual/bison.html#Conditions * License: [grammar.cpp](https://github.com/arangodb/arangodb/blob/devel/arangod/Aql/grammar.cpp#L20) +### CoreOS etcd + +* Project Home: https://coreos.com/using-coreos/etcd/ +* License: [Apache 2 License](https://github.com/coreos/etcd/blob/master/LICENSE) + ### Flex 2.5 * Project Home: http://flex.sourceforge.net/ * only used to generate code, not part of the distribution * License: [free as-is license](http://flex.sourceforge.net/manual/Copyright.html#Copyright) -## Javascript, Node and NPM +## Javascript ### Node core modules @@ -76,121 +82,121 @@ ### Bundled NPM modules -#### Jasmine +#### Ace -* https://jasmine.github.io -* [MIT License](https://raw.githubusercontent.com/jasmine/jasmine/master/MIT.LICENSE) - -#### JSUnity - -* https://github.com/atesgoral/jsunity -* [MIT License](http://www.opensource.org/licenses/mit-license.php) +* Project Home: https://github.com/ajaxorg/ace +* License: [BSD 3-Clause License](https://raw.githubusercontent.com/ajaxorg/ace/master/LICENSE) #### ArangoDB Query Builder -* https://github.com/arangodb/aqbjs -* [Apache 2](https://raw.githubusercontent.com/arangodb/aqbjs/master/LICENSE) +* Project Home: https://github.com/arangodb/aqbjs +* License: [Apache 2](https://raw.githubusercontent.com/arangodb/aqbjs/master/LICENSE) #### Chai -* http://chaijs.com -* [MIT License](https://github.com/chaijs/chai/blob/master/README.md) +* Project Home: http://chaijs.com +* License: [MIT License](https://github.com/chaijs/chai/blob/master/README.md) #### CoffeeScript -* http://coffeescript.org -* [MIT License](https://www.npmjs.com/package/coffee-script) - -#### stacktrace.js - -* http://www.stacktracejs.com/ -* [The Unlicense](http://unlicense.org) +* Project Home: http://coffeescript.org +* License: [MIT License](https://www.npmjs.com/package/coffee-script) #### expect.js -* https://github.com/Automattic/expect.js -* [MIT License](https://github.com/Automattic/expect.js/blob/master/README.md) +* Project Home: https://github.com/Automattic/expect.js +* License: [MIT License](https://github.com/Automattic/expect.js/blob/master/README.md) #### extendible -* https://github.com/3rd-Eden/extendible -* [MIT License](https://github.com/bigpipe/extendible/blob/master/README.md) +* Project Home: https://github.com/3rd-Eden/extendible +* License: [MIT License](https://github.com/bigpipe/extendible/blob/master/README.md) #### Foxx Generator -* https://github.com/moonglum/foxx_generator -* [Apache 2 License](https://raw.githubusercontent.com/moonglum/foxx_generator/master/LICENSE) +* Project Home: https://github.com/moonglum/foxx_generator +* License: [Apache 2 License](https://raw.githubusercontent.com/moonglum/foxx_generator/master/LICENSE) #### highlight.js -* https://highlightjs.org -* [BSD 3-Clause License](https://raw.githubusercontent.com/isagalaev/highlight.js/master/LICENSE) +* Project Home: https://highlightjs.org +* License: [BSD 3-Clause License](https://raw.githubusercontent.com/isagalaev/highlight.js/master/LICENSE) #### http-errors -* https://github.com/jshttp/http-errors -* [MIT License](https://raw.githubusercontent.com/jshttp/http-errors/master/LICENSE) +* Project Home: https://github.com/jshttp/http-errors +* License: [MIT License](https://raw.githubusercontent.com/jshttp/http-errors/master/LICENSE) #### inflect -* https://github.com/pksunkara/inflect -* [MIT License](https://raw.githubusercontent.com/pksunkara/inflect/master/LICENSE) +* Project Home: https://github.com/pksunkara/inflect +* License: [MIT License](https://raw.githubusercontent.com/pksunkara/inflect/master/LICENSE) + +#### Jasmine + +* Project Home: https://jasmine.github.io +* License: [MIT License](https://raw.githubusercontent.com/jasmine/jasmine/master/MIT.LICENSE) #### Joi -* https://github.com/hapijs/joi -* [BSD 3-Clause License](https://raw.githubusercontent.com/hapijs/joi/master/LICENSE) +* Project Home: https://github.com/hapijs/joi +* License: [BSD 3-Clause License](https://raw.githubusercontent.com/hapijs/joi/master/LICENSE) -#### Ace +#### JSHint -* https://github.com/ajaxorg/ace -* [BSD 3-Clause License](https://raw.githubusercontent.com/ajaxorg/ace/master/LICENSE) +* Project Home: http://jshint.com +* License: [MIT License](https://raw.githubusercontent.com/jshint/jshint/master/LICENSE) + +#### JSUnity + +* Project Home: https://github.com/atesgoral/jsunity +* License: [MIT License](http://www.opensource.org/licenses/mit-license.php) + +#### minimatch + +* Project Home: https://github.com/isaacs/minimatch +* License: [MIT License](https://raw.githubusercontent.com/isaacs/minimatch/master/LICENSE) + +#### mocha + +* Project Home: http://mochajs.org +* License: [MIT License](https://raw.githubusercontent.com/mochajs/mocha/master/LICENSE) + +#### qs + +* Project Home: https://github.com/hapijs/qs +* License: [BSD 3-Clause License](https://raw.githubusercontent.com/hapijs/hapi/master/LICENSE) + +#### Ramda + +* Project Home: http://ramdajs.com +* License: [MIT License](https://raw.githubusercontent.com/ramda/ramda/master/LICENSE.txt) + +#### semver + +* Project Home: https://github.com/npm/node-semver +* License: [BSD 2-Clause License](http://opensource.org/licenses/BSD-2-Clause) + +#### Sinon.JS + +* Project Home: http://sinonjs.org +* License: [BSD 3-Clause License](https://www.npmjs.com/package/sinon) + +#### stacktrace.js + +* Project Home: http://www.stacktracejs.com/ +* License: [The Unlicense](http://unlicense.org) + +#### underscore + +* Project Home: http://underscorejs.org +* License: [MIT License](https://github.com/jashkenas/underscore/blob/master/LICENSE) #### YAML * https://github.com/nodeca/js-yaml * [MIT License](https://raw.githubusercontent.com/nodeca/js-yaml/master/LICENSE) -#### JSHint - -* http://jshint.com -* [MIT License](https://raw.githubusercontent.com/jshint/jshint/master/LICENSE) - -#### minimatch - -* https://github.com/isaacs/minimatch -* [MIT License](https://raw.githubusercontent.com/isaacs/minimatch/master/LICENSE) - -#### mocha - -* http://mochajs.org -* [MIT License](https://raw.githubusercontent.com/mochajs/mocha/master/LICENSE) - -#### qs - -* https://github.com/hapijs/qs -* [BSD 3-Clause License](https://raw.githubusercontent.com/hapijs/hapi/master/LICENSE) - -#### Ramda - -* http://ramdajs.com -* [MIT License](https://raw.githubusercontent.com/ramda/ramda/master/LICENSE.txt) - -#### semver - -* https://github.com/npm/node-semver -* [BSD 2-Clause License](http://opensource.org/licenses/BSD-2-Clause) - -#### Sinon.JS - -* http://sinonjs.org -* [BSD 3-Clause License](https://www.npmjs.com/package/sinon) - -#### underscore - -* http://underscorejs.org -* [MIT License](https://github.com/jashkenas/underscore/blob/master/LICENSE) - ### Frontend libraries #### swagger