fatmanverse opened a new pull request, #13732:
URL: https://github.com/apache/seatunnel/pull/13732

   ### Purpose of this pull request
   
   Closes #13731.
   
   When a paginated HTTP source receives HTTP 204 or HTTP 200 with an empty 
body, it skips the code that updates pagination state. Requests can continue 
beyond `total_page_size`, and unknown-total or Cursor pagination does not stop 
on an empty response. A persistently empty endpoint can therefore keep a 
bounded read running.
   
   Extract pagination-state updates from deserialization and invoke the same 
logic for empty successful responses. Empty content has zero records and no 
next cursor. Keep explicit page limits authoritative so empty intermediate 
pages do not discard later rows.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. Empty successful responses emit no rows but now participate in 
pagination termination. A positive `total_page_size` still permits empty 
intermediate pages; unknown-total and Cursor reads stop when the response is 
empty. HTTP failures still propagate. English/Chinese HTTP docs describe these 
rules.
   
   Confirmed against `dev` at `0bef81d003a9dcc3266a10140dc639534ad81bfd`; 
released versions were not tested.
   
   ### How was this patch tested?
   
   Added `HttpSourceEmptyResponseTest` with 14 cases using a real loopback HTTP 
server. 200/204, text/JSON (including content_field), explicit limits, unknown 
total, Cursor, non-empty rows after an empty intermediate page, no pagination, 
exact request counts, completion signaling and HTTP 500 propagation.
   
   - Before the fix: 10 cases fail against the original production code.
   - After the fix: 85 HTTP-module tests pass independently on JDK 11 and JDK 
17, including 14 new cases.
   - The affected module and its upstream Maven reactor pass `verify` and 
Spotless checks on both JDKs. `spotless:apply` and a separate `-q -DskipTests 
verify` also pass.
   - Tests and builds ran on a Linux test host. No engine E2E or 
whole-repository test run is claimed.
   
   ```sh
   ./mvnw -B -ntp -pl 
seatunnel-connectors-v2/connector-http/connector-http-base -am spotless:apply
   ./mvnw -B -ntp -pl 
seatunnel-connectors-v2/connector-http/connector-http-base -am \
     -DskipITs -Dsurefire.timeout=60 \
     -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false \
     
'-Dtest=Http*Test,JsonField*Test,BinaryResponseCollectorTest,FilenameExtractorTest'
 \
     clean verify
   ./mvnw -q -pl seatunnel-connectors-v2/connector-http/connector-http-base -am 
-DskipITs -DskipTests verify
   ```
   
   ### Check list
   
   - [x] Added regression tests and updated English/Chinese documentation.
   - [x] Reviewed compatibility; no configuration option or public API is 
removed or renamed.
   - [x] No new dependencies or connector registration changes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to