在任务服务器中执行期间中断的查询

Queries interrupted during execution in the Task Server

总结

我使用任务服务器生成一系列(相同的)查询,以分配数千个文档的摄取。但是大多数查询在执行中间的某个地方被中断。知道为什么,或者如何获得更多相关信息吗?

详情

主查询(QConsole 中的 XQuery)获取目录中所有文件的路径(9,000 多个)。它创建 100 个路径块,并生成一个匿名 XQuery 函数。此函数调用 xdmp:eval-javascript,并将 100 个路径传递给它来处理它们。

评估的 Javascript 代码进行了一些计算,最终插入了 2 个文档。输入文件的 None 导致在同一 URI 处插入文档。

Javascript 代码在开头记录一条消息"start of chunk #1"(带有块的序号),然后是"end of chunk #1"。开始消息出现很多次,但结束消息每个块只出现一次(幸运的是)。

伪代码

在 QConsole 中执行的主要查询(生成匿名函数,自身计算 Javascript,只是因为它本身导入了一些 SJS 库):

let $files := ...
for $i     in 0 to 92
let $chunk := $files[(($i * 100) + 1) to (($i + 1) * 100)]
return
  xdmp:spawn-function(function() {
    xdmp:eval-javascript("
      declareUpdate();
      xdmp.log(`start of chunk ${i}`);
      for ( const f of chunk ) {
        read file
        insert 2 documents
      }
      xdmp.log(`end of chunk ${i}`);
    ")
  })

日志显示如下:

start of chunk #9
start of chunk #1
start of chunk #5
start of chunk #4
start of chunk #3
end of chunk #5
start of chunk #7
start of chunk #4     --> again
start of chunk #8
start of chunk #9     --> again
end of chunk #9
start of chunk #8     --> again
start of chunk #7     --> again
start of chunk #2
...

如您所见,相同的开始消息出现了多次。

问题

知道是什么导致了这些查询interruptions/abortions/restarts吗?或者如何找到更多信息?

Making a proper response to my own question, based on @MadsHansen comment. Thanks!

这里的技巧是死锁检测的消息在 ErrorLog.txt 中输出(而不是在 TaskServer_ErrorLog.txt 中,即使我在任务服务器上)。

它们的日志级别是 Info,这是默认值。