fatmanverse opened a new pull request, #13734:
URL: https://github.com/apache/seatunnel/pull/13734
### Purpose of this pull request
Closes #13733.
`format = binary` accepts `binary_chunk_size = 0` or `4294967296`, then
emits zero bytes and reports successful completion for a nonempty response. The
streaming buffer narrows the long value to int without checking it.
Define the valid positive-int range once and reuse it in source
initialization and the direct streaming entry before I/O. Remove the duplicate
configuration reads in the two schema branches and allocate with the validated
size.
### Does this PR introduce _any_ user-facing change?
Yes. Binary streaming chunk sizes outside `[1, 2147483647]` now fail with a
configuration error naming `binary_chunk_size` and the invalid value. The
unchanged default is 10 MiB. Users must choose a positive size that fits the
worker heap or omit the option. The int upper bound prevents narrowing
overflow; it does not guarantee that the worker has enough memory for any
chosen size.
Text/JSON sources ignore this unused option as before. The buffered
`BinaryResponseCollector` keeps its existing nonpositive-size behavior.
English/Chinese HTTP docs and migration notes describe the validation. No new
option, dependency, or public SPI change.
Confirmed on `dev` at `0bef81d003a9dcc3266a10140dc639534ad81bfd`; released
versions were not tested.
### How was this patch tested?
`HttpBinaryChunkSizeTest` adds 19 cases: invalid long boundaries with and
without schemas, direct streaming rejection before any request, payload
reconstruction/part indices/filenames for valid sizes, unchanged default,
initialization at the representable upper bound without allocating it, unused
text-mode config, and buffered collector compatibility. Original diagnostics
reproduced silent data loss on JDK 11 and 17.
**90 HTTP-module tests pass on each of JDK 11 and JDK 17**, with zero
failures, errors or skips.
The HTTP module and its 12-module upstream Maven reactor passed `clean
verify` with the HTTP test selection above, including Spotless checks, on
Temurin JDK 11 and 17. `spotless:apply` and separate `-q -DskipTests verify`
checks also passed. All execution was on a Linux test host using loopback HTTP
servers. No whole-repository test suite or engine E2E 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
```
Additional integration check: combining this change with the HTTP
query/form, empty/multiline pagination, and default-page-field fixes passed
**170 HTTP tests on each of JDK 11 and JDK 17**, with zero
failures/errors/skips. This was a temporary integration branch, not an upstream
merge.
### Check list
- [x] Added regression tests and English/Chinese docs.
- [x] Documented rejected configurations and migration guidance.
- [x] No 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]