Title: IllegalArgumentException when starting a QueryBatcher · Issue #1872 · marklogic/java-client-api · GitHub
Open Graph Title: IllegalArgumentException when starting a QueryBatcher · Issue #1872 · marklogic/java-client-api
X Title: IllegalArgumentException when starting a QueryBatcher · Issue #1872 · marklogic/java-client-api
Description: When we run our integration test-suite especially the tests using the DataMovementManager and a QueryBatcher. The LinkedBlockingQueue used in QueryBatcherImpl#QueryThreadPoolExecutor (QueryBatcherImpl line 1132) is throwing an IllegalArg...
Open Graph Description: When we run our integration test-suite especially the tests using the DataMovementManager and a QueryBatcher. The LinkedBlockingQueue used in QueryBatcherImpl#QueryThreadPoolExecutor (QueryBatcherI...
X Description: When we run our integration test-suite especially the tests using the DataMovementManager and a QueryBatcher. The LinkedBlockingQueue used in QueryBatcherImpl#QueryThreadPoolExecutor (QueryBatcherI...
Opengraph URL: https://github.com/marklogic/java-client-api/issues/1872
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"IllegalArgumentException when starting a QueryBatcher","articleBody":"When we run our integration test-suite especially the tests using the DataMovementManager and a QueryBatcher. The LinkedBlockingQueue used in QueryBatcherImpl#QueryThreadPoolExecutor (QueryBatcherImpl line 1132) is throwing an IllegalArgumentException because the poolSize is calculated to be -1. The line in question is QueryBatcherImpl#1132:\n```\nnew LinkedBlockingQueue\u003c\u003e((forestsLength * docToUriBatchRatio * 2) + threadCount)\n```\nwith forestsLength=1, **docToUriBatchRatio=-1**, threadCount=1\n\nIt is wierd that `docToUriBatchRatio` is -1. Having a look at QueryBatcherImpl#withBatchSize (line 296), which is called in our case:\n```\npublic QueryBatcher withBatchSize(int docBatchSize) {\n if (docBatchSize \u003e this.maxUriBatchSize) {\n logger.debug(\"docBatchSize is beyond maxDocBatchSize, which is {}.\", this.maxUriBatchSize);\n }\n if (docBatchSize \u003c 1) {\n throw new IllegalArgumentException(\"docBatchSize cannot be less than 1\");\n }\n requireNotStarted();\n super.withBatchSize(docBatchSize);\n this.docToUriBatchRatio = Math.min(this.maxDocToUriBatchRatio, this.maxUriBatchSize / docBatchSize);\n if (this.docToUriBatchRatio == 0) {\n this.docToUriBatchRatio = 1;\n }\n return this;\n }\n```\nit happens in line 305 due to maxDocToUriBatchRatio being -1. This -1 is taken from the forest-response given by the MarkLogic server in DataMovementServices#initConfig (line 64). (The else-branch in line 67 is not visited in our case.)\n\nSolutions:\nIt feels like the maxDocToUriBatchRatio=-1 given by the MarkLogic server is supposed to mean something like \"undefined\" or \"unlimited\". Using the -1 in the calculation for the thread pool size seems oddly wrong. If so intended, we would appreciate a proper error message like \"QueryBatcher can not be started ...\". Currently just an IllegalArgumentException without any message is thrown by the Java's native LinkedBlockingQueue.","author":{"url":"https://github.com/ralfhergert","@type":"Person","name":"ralfhergert"},"datePublished":"2026-01-02T16:18:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/1872/java-client-api/issues/1872"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b1b04ea1-f1a1-e21a-37fd-269bd133fe87 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A528:10F59A:BB24F:F5F9E:698E9DD6 |
| html-safe-nonce | e34bfe20543370e4572378cb60598726f446a13e341a50c14ecdc5d4b735d6f8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTI4OjEwRjU5QTpCQjI0RjpGNUY5RTo2OThFOURENiIsInZpc2l0b3JfaWQiOiI4ODUzMjg1NjQxNzE2MTQ1NjIyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f58778d455e674fe6da1073c7a9923bc1feac63d98c173d08e936e0b132e6b38 |
| hovercard-subject-tag | issue:3776685483 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/marklogic/java-client-api/1872/issue_layout |
| twitter:image | https://opengraph.githubassets.com/52a052caea8f17c9bb876bd053846a27d67da754db11bbda0f8fecbc1b8dfa21/marklogic/java-client-api/issues/1872 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/52a052caea8f17c9bb876bd053846a27d67da754db11bbda0f8fecbc1b8dfa21/marklogic/java-client-api/issues/1872 |
| og:image:alt | When we run our integration test-suite especially the tests using the DataMovementManager and a QueryBatcher. The LinkedBlockingQueue used in QueryBatcherImpl#QueryThreadPoolExecutor (QueryBatcherI... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ralfhergert |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb2828a801ee6b7be618f3ac76fbf55def35bbc30f053a9c41bf90210b8b72ba |
| turbo-cache-control | no-preview |
| go-import | github.com/marklogic/java-client-api git https://github.com/marklogic/java-client-api.git |
| octolytics-dimension-user_id | 189902 |
| octolytics-dimension-user_login | marklogic |
| octolytics-dimension-repository_id | 17642544 |
| octolytics-dimension-repository_nwo | marklogic/java-client-api |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 17642544 |
| octolytics-dimension-repository_network_root_nwo | marklogic/java-client-api |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e6b91a7e6e46287d26887e3fb7a4161657bab8f7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width