Difficult for me to understand
Tuesday, 3 February 2026 · 4 messages
ML
Marco Lettere3 Feb 2026 10:18 #
Hi Christian and all,
I'm experiencing a weird issue with a RestXQ service of mine which was working and suddenly starts having problems because it just stops serving requests.
I know about SSCE and so on but this time it's hard to reproduce. Shortly, it receives about 5 simultaneous requests and for each of those it calls one
xquery:fork-join (5 functions) to query another service.
I cannot say what the error is exactly during the time when it is stuck. What I can see on the client are, besides HTTP 503 and Read Timeouts, the following logs which appear frequently but with no particular order:
ERROR: Unexpected error: java.lang.NullPointerException: Cannot invoke "org.basex.util.hash.WeakTokenSet$WeakTokenRef.get()" because "this.keys[index]" is null (hint:
/...y/webapp/nubisware.muscle.fiber.ccp_admin/ccp_worker_sk.xqm@65:33)
ERROR: Unexpected error: java.lang.ArrayIndexOutOfBoundsException (hint: /.../webapp/nubisware.muscle.fiber.ccp_admin/ccp_worker_sk.xqm@65:33)
ERROR: Unexpected error: java.lang.ArrayIndexOutOfBoundsException: Index 8 out of bounds for length 8 (hint:
/.../webapp/nubisware.muscle.fiber.ccp_admin/ccp_worker_sk.xqm@65:33)
Line and column numbers point always to the same xquery:fork-join call.
Can you point me to what I should investigate? Am I hitting some quantitative limit on concurrency? Connections?
Thank you for any help because I'm currently wandering in the darkness :-)
Regards,
Marco.ML
Marco Lettere3 Feb 2026 10:29 #
Oops, forgot to mention that meanwhile I moved from 11.7 to 12.1.
Sorry.
Quoted text · Marco Lettere · 42 lines
On 03/02/26 10:18, Marco Lettere wrote: > Hi Christian and all, > > I'm experiencing a weird issue with a RestXQ service of mine which was > working and suddenly starts having problems because it just stops > serving requests. > > I know about SSCE and so on but this time it's hard to reproduce. > Shortly, it receives about 5 simultaneous requests and for each of > those it calls one xquery:fork-join (5 functions) to query another > service. > > I cannot say what the error is exactly during the time when it is > stuck. What I can see on the client are, besides HTTP 503 and Read > Timeouts, the following logs which appear frequently but with no > particular order: > > ERROR: Unexpected error: java.lang.NullPointerException: Cannot invoke > "org.basex.util.hash.WeakTokenSet$WeakTokenRef.get()" because > "this.keys[index]" is null (hint: > /...y/webapp/nubisware.muscle.fiber.ccp_admin/ccp_worker_sk.xqm@65:33) > > ERROR: Unexpected error: java.lang.ArrayIndexOutOfBoundsException > (hint: > /.../webapp/nubisware.muscle.fiber.ccp_admin/ccp_worker_sk.xqm@65:33) > > ERROR: Unexpected error: java.lang.ArrayIndexOutOfBoundsException: > Index 8 out of bounds for length 8 (hint: > /.../webapp/nubisware.muscle.fiber.ccp_admin/ccp_worker_sk.xqm@65:33) > > Line and column numbers point always to the same xquery:fork-join call. > > Can you point me to what I should investigate? Am I hitting some > quantitative limit on concurrency? Connections? > > Thank you for any help because I'm currently wandering in the darkness > :-) > > Regards, > > Marco. >
CG
Christian Grün3 Feb 2026 10:35 #
Hi Marco,
It’s just an assumption, but your problem could be related to a known
xquery:fork-join bug that became effective with BaseX 12.0 and JDK 17 [1]. We are working on it, but I cannot give a timeline yet.
You can try to minimize the code that is contained in the fork-join function. For example, code like…xquery:fork-join(
for $i in 1 to 100
return fn() {
let $url := "http://xyz.com/" || $i
return doc($url)
}
)…could be simplified to:
let $urls := (
for $i in 1 to 100
return "http://xyz.com/" || $i
)
return xquery:fork-join(
for $url in $urls
return fn() { doc($url) }
)Hope this helps; please follow the referenced GitHub issue to track the progress. Christian
[1] https://github.com/BaseXdb/basex/issues/2479
Quoted text · Marco Lettere · 48 lines
Von: Marco Lettere via BaseX-Talk <basex-talk at mailman.uni-konstanz.de> Gesendet: Dienstag, 3. Februar 2026 10:29 An: basex-talk at mailman.uni-konstanz.de <basex-talk at mailman.uni-konstanz.de> Betreff: [basex-talk] Re: Difficult for me to understand Oops, forgot to mention that meanwhile I moved from 11.7 to 12.1. Sorry. On 03/02/26 10:18, Marco Lettere wrote: > Hi Christian and all, > > I'm experiencing a weird issue with a RestXQ service of mine which was > working and suddenly starts having problems because it just stops > serving requests. > > I know about SSCE and so on but this time it's hard to reproduce. > Shortly, it receives about 5 simultaneous requests and for each of > those it calls one xquery:fork-join (5 functions) to query another > service. > > I cannot say what the error is exactly during the time when it is > stuck. What I can see on the client are, besides HTTP 503 and Read > Timeouts, the following logs which appear frequently but with no > particular order: > > ERROR: Unexpected error: java.lang.NullPointerException: Cannot invoke > "org.basex.util.hash.WeakTokenSet$WeakTokenRef.get()" because > "this.keys[index]" is null (hint: > /...y/webapp/nubisware.muscle.fiber.ccp_admin/ccp_worker_sk.xqm@65:33) > > ERROR: Unexpected error: java.lang.ArrayIndexOutOfBoundsException > (hint: > /.../webapp/nubisware.muscle.fiber.ccp_admin/ccp_worker_sk.xqm@65:33) > > ERROR: Unexpected error: java.lang.ArrayIndexOutOfBoundsException: > Index 8 out of bounds for length 8 (hint: > /.../webapp/nubisware.muscle.fiber.ccp_admin/ccp_worker_sk.xqm@65:33) > > Line and column numbers point always to the same xquery:fork-join call. > > Can you point me to what I should investigate? Am I hitting some > quantitative limit on concurrency? Connections? > > Thank you for any help because I'm currently wandering in the darkness > :-) > > Regards, > > Marco. >
ML
Marco Lettere3 Feb 2026 10:46 #
Ok, thanks for answering that quickly. Maybe I should have gone through the issues first but I've too much trust in BaseX :-)
Will watch the issue.
M.
Quoted text · Christian Grün · 87 lines
On 03/02/26 10:35, Christian Grün wrote: > Hi Marco, > > It’s just an assumption, but your problem could be related to a known > xquery:fork-join bug that became effective with BaseX 12.0 and JDK 17 > [1]. We are working on it, but I cannot give a timeline yet. > > You can try to minimize the code that is contained in the fork-join > function. For example, code like… > > xquery:fork-join( > for $i in 1 to 100 > return fn() { > let $url := "http://xyz.com/" || $i > return doc($url) > } > ) > > …could be simplified to: > > let $urls := ( > for $i in 1 to 100 > return "http://xyz.com/" || $i > ) > return xquery:fork-join( > for $url in $urls > return fn() { doc($url) } > ) > > Hope this helps; please follow the referenced GitHub issue to track > the progress. > Christian > > [1] https://github.com/BaseXdb/basex/issues/2479 > ------------------------------------------------------------------------ > *Von:* Marco Lettere via BaseX-Talk <basex-talk at mailman.uni-konstanz.de> > *Gesendet:* Dienstag, 3. Februar 2026 10:29 > *An:* basex-talk at mailman.uni-konstanz.de > <basex-talk at mailman.uni-konstanz.de> > *Betreff:* [basex-talk] Re: Difficult for me to understand > Oops, forgot to mention that meanwhile I moved from 11.7 to 12.1. > > Sorry. > > > On 03/02/26 10:18, Marco Lettere wrote: > > Hi Christian and all, > > > > I'm experiencing a weird issue with a RestXQ service of mine which was > > working and suddenly starts having problems because it just stops > > serving requests. > > > > I know about SSCE and so on but this time it's hard to reproduce. > > Shortly, it receives about 5 simultaneous requests and for each of > > those it calls one xquery:fork-join (5 functions) to query another > > service. > > > > I cannot say what the error is exactly during the time when it is > > stuck. What I can see on the client are, besides HTTP 503 and Read > > Timeouts, the following logs which appear frequently but with no > > particular order: > > > > ERROR: Unexpected error: java.lang.NullPointerException: Cannot invoke > > "org.basex.util.hash.WeakTokenSet$WeakTokenRef.get()" because > > "this.keys[index]" is null (hint: > > /...y/webapp/nubisware.muscle.fiber.ccp_admin/ccp_worker_sk.xqm@65:33) > > > > ERROR: Unexpected error: java.lang.ArrayIndexOutOfBoundsException > > (hint: > > /.../webapp/nubisware.muscle.fiber.ccp_admin/ccp_worker_sk.xqm@65:33) > > > > ERROR: Unexpected error: java.lang.ArrayIndexOutOfBoundsException: > > Index 8 out of bounds for length 8 (hint: > > /.../webapp/nubisware.muscle.fiber.ccp_admin/ccp_worker_sk.xqm@65:33) > > > > Line and column numbers point always to the same xquery:fork-join call. > > > > Can you point me to what I should investigate? Am I hitting some > > quantitative limit on concurrency? Connections? > > > > Thank you for any help because I'm currently wandering in the darkness > > :-) > > > > Regards, > > > > Marco. > >
Written for BaseX 12.2. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery