DanielLeens commented on PR #13535:
URL: https://github.com/apache/seatunnel/pull/13535#issuecomment-7248341405

   # Implementation Notes and Trade-offs
   
   Current head `b86fcf3f5b3bf62a0eacad60cf370ceb9fda1111`; incremental13-file 
correction from `00e8c02d6adcb3285b68326596eccfe2a9ac452b`, committed/pushed as 
DanielLeens. No POM/shared executable changes. External mixed-terminal 
shared-engine gate OPEN; no human-ready claim.
   
   Incoming parser: the template disables INTERN_FIELD_NAMES; every HTTP 
response uses one ObjectMapper.copy with new factory roots. 
CANONICALIZE_FIELD_NAMES stays enabled. Duplicate/trailing checks, 
depth64/number512/string2,097,152-character constraints, exact decimal 
conversion, default native encoding/BOM handling and strict malformed-UTF8 
behavior remain. Both 8MiB body caps, HttpCore framing, direct 
sockets/TLS/cancellation/retry policies are unchanged. No SDK second parser 
exists. The original per-response bound did not constrain static retained names 
across up to3660 daily reports; response ownership closes that source path 
without banning unknown adapter fields or changing a shared JSON helper. Source 
evidence establishes lifetime closure, not a heap measurement or live-provider 
acceptance.
   
   Publication and recovery: the existing worker fetches, fully converts and 
hashes one ordered day outside collector/state monitors, checking the same 
elapsed budget afterwards. Polling caches only an admitted PreparedDay and 
accepts at most one record per invocation. The sticky cancel check is before 
each collect; a collect already in progress can still wait on the downstream. 
The immutable scan advances only after successful collect; the final row 
atomically advances the day and clears the prefix under collector-before-state 
locking. Native handoff can now run between rows without a shared engine change 
or a universal latency guarantee.
   
   Private scan UID1 gains acceptedRows and an owned32byte digest. 
Constructors/copies clone digest arrays; snapshots, addSplits and enumerator 
state detach them. Native default serializers use Java object serialization: 
additive fields default0/null at earlier unreleased query boundaries, without a 
legacy migration branch. Digest framing includes row/field counts, null/type 
tags, int32BE string lengths and explicit UTF16 char high/low bytes, preserving 
accepted lone code units instead of charset replacement. Converted fixed-scale 
decimals are already precision-bounded before toPlainString. Hash all ordered 
converted rows including the unaccepted tail; ignored auxiliary provider fields 
do not affect output identity. A restored prefix must match the full day before 
caching it, skipping rows, accepting HTTP204/empty results or advancing. Failed 
admission is never cached. Token rotation, original end date and report 
signature binding remain.
   
   Callbacks/contracts: Reader and Enumerator declare the required no-op 
checkpoint-completion callback with rationale. Core ownership/state/lifecycle 
comments, named-type multiline contracts, callable-before-private helper order 
and the CancellationException import are completed. Other production method 
bodies are unchanged except the explicit parser/prepared-day/prefix/deep-copy 
corrections recorded in product-method-preservation.json. Both guides describe 
actual limits, private prefix verification and the existing 
after-completed-checkpoint replay boundary. No general exactly-once or 
remote-snapshot promise is added.
   
   Original tests: all10 original methods/scenarios remain. 
old-test-preservation.json proves the identical ordered AST of every original 
Assertions expression and critical good/fail/HTTP/job/cancel/savepoint/restore 
invocation in its original scenario body. Five calendar-sensitive bodies move 
into private Attempt helpers behind their original test entries. Stable-window 
assertions are unchanged. At most two complete attempts occur, with no sleep 
window, production clock, skip/Assumptions or count broadening; only an 
observed date change at the tested UTC/+05:30 offset permits retry. Each 
scenario's anchor covers its complete sequence of jobs and loops. A direct 
CleanupFailure or ANY suppressed cleanup error is propagated even across 
midnight: a failed/unsettled attempt can never reset the fixture and retry.
   
   The three active scenarios keep original success assertions and command 
calls. Finally now owns release, native bounded status/force-stop, future 
settlement, executor termination and file deletion in one error aggregate. 
Exact native terminal states are 
FAILED/SAVEPOINT_DONE/CANCELED/FINISHED/UNKNOWABLE; all other statuses are 
stopped, with rechecks through owned future settlement so initially absent 
status cannot skip a later generation. Stop acknowledgements must match jobId. 
Requests use the actual harness server, Proxy.NO_PROXY,2s connect/read,64KiB 
body, no redirects/cache and closed streams/disconnect. Each job/future has 
a45s settlement budget and executor await5s; per-read bounds are not an 
unconditional total wall-clock guarantee. Primary assertions survive and 
cleanup errors become suppressed CleanupFailure; successful scenarios throw 
that marker directly if cleanup fails. nextCheckpoint/awaitStatus retain their 
predicates but use this bounded HTTP boundary. The old unbo
 unded cancelIfRunning helper is replaced. No Future wraps an unbounded HTTP 
cleanup call.
   
   Terminal fixture: only jobFile's keepalive sink selection changes to two 
source-specific Console blocks. The original Fake marker, source args, 
successful stop-savepoint/cancel/restore/count assertions remain. Pinned native 
parseSink unconditionally rejects unlike schemas before Console's multi-table 
support is consulted; PipelineGenerator splits even a matching-schema union 
into per-source physical pipelines. Root and another reviewer independently 
confirmed this exact conditional. The correction does NOT fix the separate 
shared-engine completed-sibling savepoint gate: CheckpointManager still fans 
out to retained coordinators, and completed/shutdown coordinators reject 
savepoint. The retained scenario remains a source-derived conditional external 
readiness blocker pending actual post-compile CI and resolution in the owning 
scope; no shared fix, skip or savepoint substitution is included.
   
   One new existing-class IT uses40 distinct dimension groups, env1row/s, 
CP1s/timeout5s/retry0 in a dedicated dynamically generated config; old 
generated configs/budgets are unchanged. Two later completed checkpoints must 
occur while one fetched day remains partial. Successful native stop-savepoint, 
SAVEPOINT_DONE and original CLI settlement precede freezing the observed 
Console prefix. Explicit native SAVEPOINT-mode restore under a different job id 
must emit the exact suffix; prefix+suffix is each exact expected row once and 
two total report GETs. Console is accepted-output visibility, not a 
transactional periodic-checkpoint receipt. The restore helper reuses public 
ContainerUtil.copyConfigFileToContainer and executeBaseCommand with native 
-r/--set-job-id and existing client-JVM option; it does not overwrite/delete 
the original savepoint. Owned futures settle before test return, despite 
executeBaseCommand not changing the harness runningCount.
   
   The same new case supplies a modest4096-character unknown root key and 
Unicode; initial HTTP bytes are UTF16BE+BOM, stable restore UTF8+BOM, and 
encoding selection is independently recorded by the fixture. A changed 
unaccepted final metric then restores from the SAME saved state under another 
job id and must fail specifically on whole-day verification before emitting any 
tail (three GETs across positive+changed branches). Finally a fresh 
otherwise-valid report has one invalid UTF8 byte in an ignored unknown string: 
it must fail before output. This isolates malformed decoding from shape 
rejection. No cache flag inspection, global mutation, reflection, heap/OOM 
probe or new test class/matrix is added. Removing only the new 
decoded/bad_utf8/control-change branches makes the entire original Python 
fixture AST identical.
   
   Failure capability is source-derived, not an executed red/green claim: 
old40row atomic publication at1rps cannot provide the short completed-CP 
handoff; a transient cursor without durable prefix replays too many rows on 
restore; missing whole-day verification accepts the changed tail; wrong 
byte-parser fallback can replace the invalid unknown UTF8 string and 
incorrectly complete a valid report. Native-byte controls and exact 
payload/order/count assertions independently guard compatibility. The incoming 
retained-name P0 itself is closed by the native ownership proof, not by 
claiming a small fixture measured heap retention.
   
   Selected native product and E2E Spotless apply/check plus static Java/Python 
AST/diff/preservation checks are the only local validations. Selected format 
argv/log hashes and final root IT formatting receipt are recorded locally. 
Compilation, component/unit/IT/E2E, distribution/SPI packaging/RAT, live 
provider and timing/heap behavior are NOT RUN locally. Old-head CI failed on 
missing callbacks; current-head CI is pending actual execution. Source-private 
closure alone does not clear the retained external engine gate or justify 
human-ready/merge-ready/Feishu notification.
   
   Root refinement: nextCheckpoint recognizes the exact job-bound 
completed-point ACK only as terminal observation; it does not certify storage 
and never replaces actual SAVEPOINT/restore assertions. Cleanup now aggregates 
AssertionError as well as Exception, including release assertions and executor 
shutdown, retaining primary/suppressed failure semantics and preventing a 
midnight retry after cleanup failure. Root-final static/token/preservation 
receipts and the independent helper audit bind the final13-file patch.
   
   Thank you for contributing to Apache SeaTunnel.
   


-- 
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