Search code examples
arangodbfoxx

How to resolve ArangoDB Foxx deadlocking problems?


Under testing, our Foxx app is getting into "deadlock detected" problems. These seem to be caused by traversal queries. Apriori, it is difficult if not impossible to know which tables will be used during traversal. However, I did take one specific case where I could determine the number of tables and wrap the AQL in a transaction for testing:

var result = db._executeTransaction({ "collections" : { "read" : [ "pmlibrary", "pmvartype", "pmvariant", "pmproject", "pmsite", "pmpath", "pmattic" ] }, "action" : "function(){var db=require(\"@arangodb\").db;var res=db._query(\"FOR o IN ['pmlibrary/199340787'] FOR v,e,p IN 0..7 INBOUND o pm_child RETURN p.vertices\");return res.toArray()}" });

FYI, the list of tables in the collections do not include the edge tables.

However, the deadlocks on this statement continue. I'm not sure what to try next. Thanks.


Solution

  • The proper solution was to use a WITH clause rather than a transaction.