Repository navigation
fix(client): report the error message of a failed async task - #776
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
@all-contributors add @RaphaelFakhri for bug, code |
|
I've put up a pull request to add @RaphaelFakhri! 🎉 |
:java_duke: JaCoCo coverage report
|
|
||||||||||||||||||||||||||||||||||
|
HTML test reports are available as workflow artifacts (zipped HTML). • Download: Artifacts for this run |
edeandrea
left a comment
There was a problem hiding this comment.
Thanks for this, @RaphaelFakhri — a clear issue report and the fix goes in at the right layer. I appreciate that you went looking at what the poll response actually carries rather than just reworking the message text.
Worth recording something I checked while reviewing, because it makes the change look better than the description claims. Upstream TaskStatusResponse actually carries two failure fields, error_message and failure, and I went in half-expecting to ask why you'd picked the thinner one. It turns out to be the opposite:
| Orchestrator | error_message |
failure |
|---|---|---|
local (what DoclingServeContainer runs) |
yes | no |
| RQ | yes | no |
| Ray | yes | yes |
Only the Ray dispatcher populates failure, and it only exists from docling-serve v1.25.0, whereas error_message comes back from every tag in our compatibility table down to v1.18.0. So this picks the one field that works for everybody. I've opened #778 to track the other one separately.
Three requests below, all in tests and docs — the production change itself is good as it stands. Two further comments are just me confirming things are right, so you don't have to wonder whether they're veiled asks.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
edeandrea
left a comment
There was a problem hiding this comment.
Thanks @RaphaelFakhri — this is great work. Every request from the last round was addressed exactly as asked: the failure tests now live in their own AsyncTaskFailureTests class, the four extra cases pin the whole FAILURE decision tree (including the blank-message guard and the chunk path), and the docs note about error sanitization will save someone a confusing bug report later. I also appreciated you confirming the new tests fail against the old code — that's exactly the kind of check that makes a review easy.
I merged this onto current main locally and the new tests pass on both Jackson backends, with spotless clean. Approving and setting to auto-merge. Thanks again for the contribution! 🎉
Signed-off-by: Raphael Fakhri <153192858+RaphaelFakhri@users.noreply.github.com>
Signed-off-by: Raphael Fakhri <153192858+RaphaelFakhri@users.noreply.github.com>
Signed-off-by: Raphael Fakhri <153192858+RaphaelFakhri@users.noreply.github.com>
1c7fb93 to
10958f9
Compare
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
What
When an async conversion or chunking task fails, the client builds the exception message from
task_meta, which only holds document counts:Docling Serve reports the cause of the failure in the
error_messagefield of the status poll response, butTaskStatusPollResponsedoesn't map it, so the cause is lost.How
TaskStatusPollResponsegains a nullableerrorMessagefield, mapped fromerror_message.FAILURE,AsyncOperationsuseserrorMessagewhen it is not blank. Otherwise it falls back to the task metadata, then toTask failed, as before.whats-new.mdhas an entry for the change.With the response above plus
"error_message": "Input document is not valid", the message is now:Tests
New
failedTaskReportsTheErrorMessageOfTheServerinAbstractDoclingServeClientAsyncExecutorTests, so both Jackson backends run it. It stubs a failed task witherror_messagein WireMock and checks the root cause message.TaskStatusMetadata(...))../gradlew --no-daemon :docling-serve-client:test --tests '*AsyncExecutorTests' :docling-serve-api:test spotlessCheckpasses (14 and 246 tests, 0 failures). The existingfailedTaskRunsEveryPollOnCustomExecutortest, which has neither field, still getsTask failed.Related
Closes #775