Skip to content

[Fix][Zeta] Bound observability edge-override warning cache #12225 - #12226

Open
AzazelSensei wants to merge 3 commits into
apache:devfrom
AzazelSensei:fix-12225-observability-warning-cache
Open

AzazelSensei wants to merge 3 commits into
apache:devfrom
AzazelSensei:fix-12225-observability-warning-cache

Conversation

@AzazelSensei

Copy link
Copy Markdown

Purpose of this pull request

Invalid edge_overrides warning keys were stored in a process-wide set with no bound, so distinct bad configs kept growing retained heap. I switched uniqueness to warning categories and capped the set.

Does this PR introduce any user-facing change?

No. Validation, clamping, and enablement are unchanged. The first warning of each category is still logged.

How was this patch tested?

Unit tests in ObservabilityConfigTest for valid inputs, distinct invalid inputs, repeats, and concurrent parsing.

Fixes #12225

Check list

@DanielLeens DanielLeens 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.

What Problem Does This PR Solve?

Welcome, and thank you for the first contribution to Apache SeaTunnel!

ObservabilityConfig.warnOnce() deduplicates "invalid edge_overrides config" warnings using a process-wide static Set<String> (LOGGED_EDGE_OVERRIDE_ISSUES). Before this PR, the dedup key embedded the actual offending value (e.g. "edge_overrides:negative:" + boundary + ":" + cap, or "edge_overrides:missing:" + map.keySet()), so every distinct bad boundary name / capacity value / map-key combination across every job ever submitted to that master process created a brand-new, permanently-retained entry. Since ObservabilityConfig.fromEnvOptions() is invoked from ExecutionPlanGenerator and PhysicalPlanGenerator on every job submission (and RealtimeMetricsService), a cluster that processes many jobs/day with varying (even accidentally-varying) invalid edge_overrides configs would accumulate unbounded heap in this static set for the lifetime of the master JVM — exactly what linked issue #12225 reproduces and documents with a weak-reference/heap-growth repro against dev. This PR fixes the root cause by keying the dedup set on a small, fixed set of warning categories instead of caller-supplied values, and adds a defensive hard cap (MAX_LOGGED_EDGE_OVERRIDE_ISSUES = 32) on top.

1. Code Change Review

1.1 Core Logic Analysis

Before/after for one of the five call sites (all five follow the same shape):

// before
warnOnce("edge_overrides:negative:" + boundary + ":" + cap, ...);
// after
warnOnce("edge_overrides:negative", ...);
// warnOnce before
private static void warnOnce(String uniqKey, String message, Object... args) {
    if (!LOGGED_EDGE_OVERRIDE_ISSUES.add(uniqKey)) {
        return;
    }
    log.warn(message, args);
}

// warnOnce after
private static void warnOnce(String uniqKey, String message, Object... args) {
    if (LOGGED_EDGE_OVERRIDE_ISSUES.contains(uniqKey)) {
        return;
    }
    if (LOGGED_EDGE_OVERRIDE_ISSUES.size() >= MAX_LOGGED_EDGE_OVERRIDE_ISSUES) {
        return;
    }
    if (!LOGGED_EDGE_OVERRIDE_ISSUES.add(uniqKey)) {
        return;
    }
    log.warn(message, args);
}

This is a correct, minimal fix for the root cause. There are only five possible category keys in the entire class (edge_overrides:not_map, :missing, :negative, :too_large, :invalid), so after this change the set can never realistically grow past 5 entries, well under the 32-entry safety cap — the leak described in #12225 is closed. Importantly, the content of the warning is unaffected: warnOnce still receives the real boundary/capacity/key values as SLF4J format args, so the first occurrence of each category still logs a concrete, useful example (whichever job triggered it first); only the dedup key was narrowed.

Runtime call chain (why this matters — this is master-side, concurrent, cross-job state):

Job submission (master)
  -> ExecutionPlanGenerator(logicalPlan, ...)            [constructor]
       -> ObservabilityConfig.fromEnvOptions(envOptions)
            -> getEdgeOverrides(config, "engine.observability.edge_overrides")
                 -> warnOnce(category, msg, args)          [static, cross-job set]
  -> PhysicalPlanGenerator(executionPlan, ...)            [constructor, same static set]
       -> ObservabilityConfig.fromEnvOptions(...)  (again, same job)
  -> RealtimeMetricsService                                [master aggregation, same static set]

Multiple jobs can be submitted concurrently on the master, so warnOnce is genuinely exercised under concurrency across unrelated jobs — this is exactly what the new testConcurrentInvalidEdgeOverrideParsingStaysBounded test exercises (see 2.2).

Worth flagging as an intentional trade-off rather than a bug: because LOGGED_EDGE_OVERRIDE_ISSUES is a static, cross-job, process-lifetime set, once any job anywhere in the cluster trips a given category (e.g. edge_overrides:negative), no other, unrelated job with a different boundary name that also has a negative capacity will ever see that warning logged again until the master process restarts. Before this PR the same was roughly true only for byte-for-byte identical mistakes; now it's true for the whole category. This is a reasonable and common "log-noise suppression" pattern for a validation warning that doesn't affect correctness (the bad override is still dropped/clamped regardless of whether it's logged), so I'm not treating it as a blocker — see Issue 1 below for a documentation-only suggestion.

1.2 Compatibility Impact

Fully compatible. Per the PR description and confirmed by reading the surrounding class: validation, clamping, and enablement resolution are byte-for-byte unchanged; only the warning-log dedup key and a size cap were touched. No serialization format, checkpoint state, or public API is involved.

1.3 Performance / Side-Effect Analysis

This directly fixes the unbounded heap-retention issue from #12225: retained set size is now bounded by a small constant (effectively 5, hard-capped at 32) instead of growing with the cumulative number of distinct invalid configs seen over the master's lifetime. No new locks, no new blocking calls; ConcurrentHashMap.newKeySet() was already in use and remains lock-free.

1.4 Error Handling and Logging

Issue 1: Cross-job warning suppression is not documented as an operational trade-off (non-blocking)

  • Location: ObservabilityConfig.java:51-54 (Javadoc on LOGGED_EDGE_OVERRIDE_ISSUES)
  • Problem: The existing Javadoc explains why the key was narrowed to categories (bounded memory) but doesn't mention the resulting operational effect: after the first occurrence of a category anywhere in the process's lifetime, every other job's occurrence of that same category is silently suppressed, not just repeats from the same job/config.
  • Potential risk: An operator debugging "why isn't job X's edge_overrides warning showing up in the log" could be confused when a completely unrelated job's earlier mistake in the same category already exhausted that category's one-time log line. Low risk since the actual override handling (drop/clamp) is unaffected — this only affects diagnostic visibility.
  • Best improvement: Add one sentence to the existing Javadoc, e.g. "Note: after the first occurrence of a category, later occurrences from any job are also suppressed until process restart." A one-line addition, not a code change.
  • Severity: Low
  • Raised by another reviewer: No

Issue 2: warnOnce's size-then-add sequence is not atomic as a whole (theoretical, non-blocking)

  • Location: ObservabilityConfig.java:320-331
  • Problem: contains() -> size() >= MAX -> add() are three separate lock-free operations on the ConcurrentHashMap-backed key set. Under concurrent calls with genuinely distinct new category keys landing exactly at the MAX_LOGGED_EDGE_OVERRIDE_ISSUES boundary, the set could theoretically overshoot the cap by a small amount (bounded by the number of concurrently-racing distinct-new-key calls).
  • Potential risk: Practically none today — there are only 5 hardcoded category strings in the entire class, so the set can never approach the 32-entry cap regardless of this race, no matter how much concurrency there is.
  • Best improvement: No action needed now; if a future contributor ever turns this into a larger, more dynamic category space, revisit with a hard atomic bound (e.g. computeIfAbsent-style single CAS, or an explicit counter with compareAndSet).
  • Severity: Low
  • Raised by another reviewer: No

2. Code Quality Assessment

2.1 Coding Standards

New constant MAX_LOGGED_EDGE_OVERRIDE_ISSUES and the retained LOGGED_EDGE_OVERRIDE_ISSUES field both have clear, accurate Javadoc explaining the "why" (bounded memory, categories are finite). The modified warnOnce private method itself has no doc comment, but it's a small, self-explanatory 12-line private helper and this matches the rest of the class's style (other private helpers like getLong/getBoolean are also undocumented) — not flagging as a gap.

2.2 Test Coverage and Test Stability

Rating: Stable.

Three new tests, all directly exercising the fixed code path:

  • testValidEdgeOverridesDoNotRetainWarningKeys (ObservabilityConfigTest.java:137-142): 200 distinct valid configs never touch the warning set — confirms the happy path is untouched.
  • testDistinctInvalidEdgeOverridesStayBounded (ObservabilityConfigTest.java:144-162): 500 distinct-boundary negative-capacity configs, then 500 more repeats, then the original 500 again — asserts the set size stabilizes after the first hit and never grows further. This is the direct regression test for #12225's reproduction scenario.
  • testConcurrentInvalidEdgeOverrideParsingStaysBounded (ObservabilityConfigTest.java:164-190): 8 threads x 200 concurrent invalid submissions, asserting the set stays <= max and >= 1 after all futures complete. This is the one that actually exercises the concurrency path that matters for a cross-job static set touched by parallel job submissions.

All three are deterministic: no Thread.sleep-based waiting on async state, ExecutorService results are awaited via future.get() before assertions, and the pool is cleaned up in a finally. A new @BeforeEach reflectively clears the static set before every test, which correctly isolates ObservabilityConfigTest's own tests from each other (the module doesn't enable JUnit5 parallel execution, so no cross-test-class race is introduced either). I traced the root-cause claim in linked issue #12225 against ObservabilityConfig.java on dev and confirmed the reproduction is accurate: the callers (ExecutionPlanGenerator:72, PhysicalPlanGenerator:159, RealtimeMetricsService:318) and the unbounded-key mechanism match exactly what's described.

2.3 Documentation Updates

N/A — internal engine behavior, no user-facing config or docs changed (matches the "No" answer to "Does this PR introduce any user-facing change?").

3. Architectural Soundness

3.1 Elegance of the Solution

Precise fix. It targets the actual root cause (dedup key carrying unbounded caller-supplied data) rather than papering over the symptom with, say, a periodic clear or a raw LRU cache — and it does so with a minimal, easy-to-reason-about diff.

3.2 Maintainability

Good. The Javadoc on the retained field explains the finite-category assumption clearly, which is exactly the kind of invariant a future contributor needs to know about before adding a sixth warning category with caller-supplied uniqueness baked back in.

3.3 Extensibility

If a future warning category legitimately needs per-job or per-boundary distinction again, the current fixed 32-cap would need re-evaluating (see Issue 2) — but that's a hypothetical future concern, not a present one.

3.4 Historical-Version Compatibility

N/A — no serialization, checkpoint, or protocol surface touched; purely an internal, in-process log-dedup mechanism.

4. Issue Summary

# Issue Location Severity
1 Cross-job, process-lifetime warning suppression not called out in the Javadoc ObservabilityConfig.java:51-54 Low
2 warnOnce size-check-then-add is not atomic as a whole (theoretical, moot given only 5 possible keys today) ObservabilityConfig.java:320-331 Low

5. Merge Recommendation

Conclusion: Ready to merge

  1. Blockers — none.
  2. Recommended fixes (non-blocking): consider the one-sentence Javadoc addition in Issue 1 for future operator clarity.

Overall: this is a focused, well-tested fix that correctly addresses the root cause described in #12225 (verified by reading the actual call chain, not just trusting the issue text) rather than a workaround. The new concurrent test is a meaningful addition given the static field is genuinely shared across concurrent job submissions on the master. No compatibility concerns, no user-facing behavior change. Nice first PR — looking forward to more.

@nzw921rx

Copy link
Copy Markdown
Member
image

please enable CI ,thanks🔥

@nzw921rx nzw921rx added the First-time contributor First-time contributor label Sep 11, 2026
@AzazelSensei
AzazelSensei force-pushed the fix-12225-observability-warning-cache branch from 3ede593 to 1b48097 Compare September 11, 2026 05:23
@AzazelSensei

Copy link
Copy Markdown
Author

Enabled GitHub Actions on my fork. Build should be running now.

@DanielLeens DanielLeens 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.

Thanks for the update. I re-reviewed the current head from scratch (full diff and runtime path, not just the delta) per our re-review protocol, rather than assuming my previous round still applies unchanged.

What Problem Does This PR Solve?

ObservabilityConfig.warnOnce() deduplicates "invalid edge_overrides config" warnings using a process-wide static Set<String> (LOGGED_EDGE_OVERRIDE_ISSUES). Before this PR, the dedup key embedded the actual offending value (e.g. "edge_overrides:negative:" + boundary + ":" + cap), so every distinct bad boundary/capacity/map-key combination across every job ever submitted to that master process created a brand-new, permanently-retained entry — unbounded heap growth over the JVM's lifetime, exactly as reproduced in linked issue #12225. This PR keys the dedup set on a small, fixed set of warning categories instead of caller-supplied values, and adds a defensive hard cap (MAX_LOGGED_EDGE_OVERRIDE_ISSUES = 32) on top.

Fix approach: narrow warnOnce's dedup key to one of five fixed category strings per call site, and bound the set size defensively.

One-sentence summary: this closes an unbounded, master-process-lifetime memory leak in a config-validation warning path with a minimal, root-cause fix.

1. Code Change Review

1.1 Core Logic Analysis

What changed since my last review: nothing in the code. The only new commit on this head, 1b48097f84 ("Trigger fork Build workflow for CI"), is an empty commit with zero file changes — I confirmed this directly via gh api repos/apache/seatunnel/commits/1b48097f84... ("files":[]). The diff I re-traced on the current head is byte-for-byte identical to what I reviewed on d7c4f00f56, confined to ObservabilityConfig.java (production) and ObservabilityConfigTest.java (tests).

I re-walked the change independently rather than trusting my prior notes:

// before (one of five call sites, all the same shape)
warnOnce("edge_overrides:negative:" + boundary + ":" + cap, ...);
// after
warnOnce("edge_overrides:negative", ...);

// warnOnce before
private static void warnOnce(String uniqKey, String message, Object... args) {
    if (!LOGGED_EDGE_OVERRIDE_ISSUES.add(uniqKey)) {
        return;
    }
    log.warn(message, args);
}

// warnOnce after
private static void warnOnce(String uniqKey, String message, Object... args) {
    if (LOGGED_EDGE_OVERRIDE_ISSUES.contains(uniqKey)) {
        return;
    }
    if (LOGGED_EDGE_OVERRIDE_ISSUES.size() >= MAX_LOGGED_EDGE_OVERRIDE_ISSUES) {
        return;
    }
    if (!LOGGED_EDGE_OVERRIDE_ISSUES.add(uniqKey)) {
        return;
    }
    log.warn(message, args);
}

There are only five possible category keys in the whole class (edge_overrides:not_map, :missing, :negative, :too_large, :invalid), so the set can never realistically exceed 5 entries, well under the 32-entry safety cap. The warning content is unaffected — warnOnce still receives the real boundary/capacity/key values as SLF4J format args, only the dedup key was narrowed.

Runtime call chain (master-side, concurrent, cross-job static state):

Job submission (master)
  -> ExecutionPlanGenerator(logicalPlan, ...)
       -> ObservabilityConfig.fromEnvOptions(envOptions)
            -> getEdgeOverrides(...) -> warnOnce(category, msg, args)   [static, cross-job set]
  -> PhysicalPlanGenerator(executionPlan, ...)   (same static set, same job)
  -> RealtimeMetricsService                       (same static set)

Since multiple jobs can be submitted concurrently on the master, warnOnce is genuinely exercised under real concurrency across unrelated jobs, which is exactly what testConcurrentInvalidEdgeOverrideParsingStaysBounded exercises.

Key findings:

  • The normal path reaches this logic on every job submission that has an engine.observability.edge_overrides config, via ExecutionPlanGenerator/PhysicalPlanGenerator — this is a real, frequently-hit path, not a boundary case.
  • This is a precise, root-cause fix, not a workaround: it targets the actual defect (dedup key carrying unbounded caller-supplied data) rather than papering over the symptom with a periodic clear or an LRU cache.
  • The implementation still has one intentional trade-off (documented below as Issue 1, non-blocking): the suppression is now cross-job, not just cross-repeat, for the lifetime of the process.

1.2 Compatibility Impact

Fully compatible. Validation, clamping, and enablement resolution are byte-for-byte unchanged; only the warning-log dedup key and a size cap were touched. No serialization format, checkpoint state, or public API is involved. No config option, default value, or protocol field changes.

1.3 Performance / Side-Effect Analysis

This directly fixes the unbounded heap-retention issue from #12225: retained set size is now bounded by a small constant (effectively 5, hard-capped at 32) instead of growing with the cumulative number of distinct invalid configs seen over the master's lifetime. No new locks, no new blocking calls; ConcurrentHashMap.newKeySet() was already in use and remains lock-free. Given this only runs once per job-plan-generation call (not per row, not on any hot per-record path), there is no meaningful CPU/GC concern even at high job-submission rates.

1.4 Error Handling and Logging

No exceptions are swallowed and no sensitive data is logged. The change only affects whether/how often a warning is emitted, not the underlying validation/clamping behavior (invalid overrides are still dropped/clamped exactly as before).

2. Code Quality Assessment

2.1 Coding Standards

MAX_LOGGED_EDGE_OVERRIDE_ISSUES and LOGGED_EDGE_OVERRIDE_ISSUES both carry clear Javadoc explaining the "why" (bounded memory, finite category space). warnOnce itself has no doc comment, but it's a small, self-explanatory private helper consistent with the rest of the class's style (other private helpers are similarly undocumented) — not flagging as a gap.

2.2 Test Coverage and Test Stability

Rating: Stable. Three new tests directly exercise the fixed path:

  • testValidEdgeOverridesDoNotRetainWarningKeys — 200 distinct valid configs never touch the warning set (happy path untouched).
  • testDistinctInvalidEdgeOverridesStayBounded — 500 distinct-boundary invalid configs, then 500 repeats, then the original 500 again; asserts the set size stabilizes after the first hit and never grows further. This is the direct regression test for #12225's reproduction scenario.
  • testConcurrentInvalidEdgeOverrideParsingStaysBounded — 8 threads x 200 concurrent invalid submissions, asserting the set stays bounded after all futures complete via future.get() (no Thread.sleep-based synchronization). This is the one that actually exercises the concurrency path that matters for a cross-job static set touched by parallel job submissions.

All three are deterministic: futures are awaited via .get() before assertions, a @BeforeEach reflectively clears the static set before every test (correctly isolating this test class's own tests from each other), no fixed ports, no wall-clock dependency, no shared mutable state left dangling between tests. I traced the #12225 reproduction claim against ObservabilityConfig.java and confirmed the callers (ExecutionPlanGenerator, PhysicalPlanGenerator, RealtimeMetricsService) and the unbounded-key mechanism match exactly what's described. No flaky-test anti-patterns found.

2.3 Documentation Updates

N/A — internal engine behavior only, no user-facing config or docs changed (matches the PR's own "No" answer to "Does this PR introduce any user-facing change?").

3. Architectural Soundness

3.1 Elegance of the Solution

Precise fix. Targets the actual root cause (dedup key carrying unbounded caller-supplied data) with a minimal, easy-to-reason-about diff, rather than a periodic-clear or LRU-cache workaround.

3.2 Maintainability

Good — the Javadoc on the retained field clearly documents the finite-category assumption a future contributor needs to know before adding a sixth warning category with caller-supplied uniqueness baked back in.

3.3 Extensibility

If a future warning category legitimately needs per-job or per-boundary distinction again, the fixed 32-entry cap would need re-evaluating — a hypothetical future concern, not a present one.

3.4 Historical-Version Compatibility

N/A — no serialization, checkpoint, or protocol surface touched; purely an internal, in-process log-dedup mechanism.

4. Issue Summary

# Issue Location Severity
1 Cross-job, process-lifetime warning suppression is not called out in the Javadoc (an operator debugging "why isn't job X's warning showing" could be confused when a different job's earlier occurrence of the same category already consumed that category's one-time log line) ObservabilityConfig.java:51-54 Low
2 warnOnce's contains() -> size() >= MAX -> add() sequence is not atomic as a whole; theoretically the set could overshoot the cap under concurrent new-category submissions. Moot today since there are only 5 possible category keys in the entire class. ObservabilityConfig.java:320-331 Low

5. Merge Recommendation

Conclusion: Ready to merge

  1. Blockers — must be fixed: None.
  2. Recommended fixes — non-blocking: Issue 1 (one-sentence Javadoc addition documenting the cross-job suppression trade-off) and Issue 2 (theoretical, no action needed given the current fixed 5-key space) are both good, low-risk follow-ups, not required for this PR.

CI status: the current head's own diff has not changed since my last review, so my prior "Ready to merge" technical conclusion stands unmodified. I did check the current apache-side Build check, which shows FAILURE — but per this project's usual fork-CI setup, I went to the actual fork run (AzazelSensei/seatunnel run 34565776913, triggered by the empty CI-retrigger commit after CI was enabled on the fork) rather than trusting the apache-side pointer. The real failures there are all-connectors-it-2, all-connectors-it-7, rocketmq-connector-it, and jdbc-connectors-it-part-6 — I pulled the rocketmq-connector-it log directly and the failure signature (RocketMqIT.* failing inside generateTestData with MQClient errors, 14 failures/29 errors out of 87 tests) matches a known RocketMQ broker-container-timing flake I've independently observed on unrelated PRs' fork runs this same day, and none of these four failing jobs touch seatunnel-engine or anything this PR's diff (confined to ObservabilityConfig.java) could plausibly affect. I'm treating this as environmental flake, not a regression introduced by this PR.

Overall assessment: this remains a focused, well-tested, root-cause fix with no compatibility concerns and no code change since my last full review — I have nothing new to add on the implementation itself. Since I have comment-only review rights on this repo, a maintainer with write-level review permission should give the formal approve/merge; I'd suggest re-running the four unrelated failing IT jobs (or confirming via dev history that they're a known flake class) rather than blocking on them, since none are topically connected to this change. Nice, clean first PR — thanks again for the contribution.

@DanielLeens

Copy link
Copy Markdown
Contributor

Pushed merge commit 5d47b6c6e20 (current dev into your branch), @AzazelSensei. No conflicts and ObservabilityConfig.java is unchanged by the merge; the goal is a fresh CI run, since the last Build result is from 2026-09-09 (fork run 34565776913) and its red jobs (all-connectors-it-2/7, rocketmq-connector-it, jdbc-connectors-it-part-6, the cancelled kudu-connector-it) were environmental at that time, as noted in my last review.

Your fork did not create a Build run for this push; if none appears, please start one from the Actions tab ("Run workflow" on Build). I started a verification run of the same head on my fork: https://github.com/DanielLeens/seatunnel/actions?query=branch%3Apr12226-verify-5d47b6c6e20

@DanielLeens DanielLeens 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.

Thanks again for working on this, @AzazelSensei! I went through the full diff of the current head 5d47b6c6e (a merge of current dev into your branch) from scratch, not only the merge delta. This is static analysis only; I did not run anything locally.

What Problem Does This PR Solve?

  • Pain point: ObservabilityConfig.warnOnce deduplicated "invalid edge_overrides" warnings in a process-wide static set whose keys embedded the offending values (boundary, capacity, map keys). Every distinct bad config submitted to a master therefore added a permanent entry, which is unbounded heap growth (#12225).
  • Fix approach: key the set by five fixed warning categories and add a defensive cap of 32 entries; the real values are still passed as log arguments.
  • Summary: closes an unbounded master-lifetime retention in a config-validation warning path with a minimal change.

1. Code Change Review

1.1 Core Logic Analysis

The diff against the dev merge base touches only ObservabilityConfig.java and ObservabilityConfigTest.java. Both are identical to the head I last reviewed (1b48097f8): git diff 1b48097f84 5d47b6c6e2 over those two files is empty, so the merge brought in nothing that touches this change.

// before: key carries caller data -> unbounded
warnOnce("edge_overrides:negative:" + boundary + ":" + cap, ...);
// after: finite category
warnOnce("edge_overrides:negative", ..., boundary, cap);
job submission on master
  -> ExecutionPlanGenerator / PhysicalPlanGenerator / RealtimeMetricsService
     -> ObservabilityConfig.fromEnvOptions -> parse edge_overrides
        -> warnOnce(category, msg, args)   // static set shared by all jobs

The normal path hits this code on every job submission that sets engine.observability.edge_overrides; it is not a recovery or boundary path. There are exactly five category keys in the class (not_map, missing, negative, too_large, invalid), so the set cannot exceed five entries and the cap of 32 is a safety net only.

1.2 Compatibility Impact

Fully compatible. Validation, clamping and enablement are unchanged; only the log-dedup key and a size guard changed. No config option, default, serialization, checkpoint or API change.

1.3 Performance / Side-Effect Analysis

Retained memory goes from unbounded to at most five small strings. The code runs once per plan generation, not per record. ConcurrentHashMap.newKeySet() stays lock-free.

1.4 Error Handling and Logging

No exception handling changed and no sensitive data is logged. Behavior difference to be aware of: because dedup is now per category for the whole process lifetime, a second job with a different invalid value in the same category will not log its own warning (only the first one per category is logged, with that job's values).

Issue 1 (Low, non-blocking; already noted in my previous round)

  • Location: ObservabilityConfig.java:49-54 (field Javadoc) and ObservabilityConfig.java:320-331 (warnOnce).
  • Problem: the cross-job, process-lifetime suppression is a deliberate trade-off but is not stated in the Javadoc.
  • Risk: an operator asking why job X's bad edge_overrides is not warned about may not know an earlier job consumed the category.
  • Best improvement: one sentence in the Javadoc of LOGGED_EDGE_OVERRIDE_ISSUES.
  • Raised by other reviewer: no.

Issue 2 (Low, non-blocking; already noted)

  • Location: ObservabilityConfig.java:320-331.
  • Problem: contains -> size() >= MAX -> add is not atomic as a whole, so the cap could theoretically be overshot by concurrent new categories.
  • Risk: none today, because only five keys exist.
  • Best improvement: none needed now.
  • Raised by other reviewer: no.

2. Code Quality Assessment

2.1 Coding Standards

New constants carry Javadoc explaining why the keys are categories and why a cap exists. No wildcard imports, no System.out.

2.2 Test Coverage and Test Stability

Stability rating: Stable (with one note). Three new tests cover valid configs (no key retained), 500 distinct invalid configs plus repeats (size stays flat), and 8x200 concurrent parses (futures awaited with get(), no sleeps, no ports). Reverting to value-bearing keys would make the 500-distinct test fail because the set would exceed the cap.

Issue 3 (Low, non-blocking)

  • Location: ObservabilityConfigTest.java helpers loggedEdgeOverrideIssues / maxLoggedEdgeOverrideIssues.
  • Problem: the tests read the private static set and constant through reflection and clear a static in @BeforeEach.
  • Risk: renaming those fields breaks the tests at runtime rather than at compile time; clearing the static set could in theory interact with other tests in the same JVM that assert on warning output (I found none in this module).
  • Best improvement: expose a package-private accessor or a small @VisibleForTesting size getter instead of reflection.
  • Raised by other reviewer: no.

2.3 Documentation Updates

No user-visible behavior change, so no docs/en or docs/zh update is needed.

3. Architectural Soundness

3.1 Elegance

Precise root-cause fix: the defect was the key carrying unbounded data, and that is exactly what changed. No periodic clear or LRU workaround.

3.2 - 3.3 Maintainability and Extensibility

Simple and local. If a future warning category needs per-value distinction, the cap of 32 would need to be revisited.

3.4 Historical-Version Compatibility

Not applicable: no serialization, state or protocol surface is touched.

4. Issue Summary

Number Issue Location Severity
1 Cross-job process-lifetime suppression not documented in Javadoc ObservabilityConfig.java:49-54 Low
2 warnOnce check-then-add is not atomic (moot with 5 keys) ObservabilityConfig.java:320-331 Low
3 Tests use reflection on private static fields ObservabilityConfigTest.java Low

5. Merge Recommendation

Conclusion: Ready to merge

Blockers: none from source, tests or docs. The code is unchanged since the head I reviewed before.

CI status (a fact, not a code issue): the Apache-side Build check on this head shows action_required, which means your fork did not start a Build run for the merge commit. Please start one from the Actions tab of your fork ("Run workflow" on Build), or use the verification run on my fork, which was still queued when I checked. Your earlier fork run on 1b48097f8 had red jobs (all-connectors-it-2/7, rocketmq-connector-it, jdbc-connectors-it-part-6) that do not touch seatunnel-engine and looked environmental when I inspected them at that time. Current dev itself is not fully green either, so please do not chase unrelated failures. A committer with write access still has to give the formal approval.

Recommended non-blocking: Issues 1 to 3 above.

Overall: a focused, well-tested first contribution. Nicely done.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

First-time contributor First-time contributor Zeta

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][Zeta] Observability warning deduplication retains unbounded configuration keys

3 participants