Skip to content

[Backport] QueryResource: Don't close JSON content on error. (#17034)#17303

Merged
abhishekagarwal87 merged 1 commit intoapache:31.0.0from
AmatyaAvadhanula:backport-17034
Oct 9, 2024
Merged

[Backport] QueryResource: Don't close JSON content on error. (#17034)#17303
abhishekagarwal87 merged 1 commit intoapache:31.0.0from
AmatyaAvadhanula:backport-17034

Conversation

@AmatyaAvadhanula
Copy link
Copy Markdown
Contributor

Backport #17034 to 31.0.0

* QueryResource: Don't close JSON content on error.

Following similar issues fixed in apache#11685 and apache#15880, this patch fixes
a bug where QueryResource would write a closing array marker if it
encountered an exception after starting to push results. This makes it
difficult for callers to detect errors.

The prior patches didn't catch this problem because QueryResource uses
the ObjectMapper in a unique way, through writeValuesAsArray, which
doesn't respect the global AUTO_CLOSE_JSON_CONTENT setting.

* Fix usage of customized ObjectMappers.
@AmatyaAvadhanula AmatyaAvadhanula added this to the 31.0.0 milestone Oct 9, 2024
@abhishekagarwal87 abhishekagarwal87 merged commit 9b90d9c into apache:31.0.0 Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants