Skip to content

[ISSUE #6842] Handle missing data in HTTP long-polling responses - #6979

Open
yykaue wants to merge 2 commits into
apache:masterfrom
yykaue:fix-6842-handle-missing-polling-data
Open

[ISSUE #6842] Handle missing data in HTTP long-polling responses#6979
yykaue wants to merge 2 commits into
apache:masterfrom
yykaue:fix-6842-handle-missing-polling-data

Conversation

@yykaue

@yykaue yykaue commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

This PR fixes the null handling in HttpSyncDataService.doLongPolling().

HTTP long-polling responses without configuration change data are now treated as “no change” instead of causing an exception.

The following response cases are handled:

  • The data field is missing.
  • The data field is null.
  • The root response is null.
  • The response body is empty.

Valid data arrays continue to use the existing processing flow.

Closes #6842

@Aias00, could you please help review this PR? Thanks!

@Aias00 Aias00 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This now treats admin error payloads as successful no-change responses. The admin exception handlers return ShenyuAdminResult.error(...) bodies such as {"code":500,"message":"..."} without setting a non-200 HTTP status, and this branch returns as soon as data is missing/null before checking the result code. In HttpLongPollingTask, only exceptions from doLongPolling trigger the retry/backoff path, so a listener-side error body can now be swallowed as no change and the loop immediately continues. Could we check code first and throw/retry when it is present and not CommonErrorCode.SUCCESSFUL, then only ignore missing/null data for successful responses?

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.

[BUG] HttpSyncDataService.doLongPolling NPE on missing/null data key in admin response

2 participants