luoyuan3471 opened a new pull request, #8953: URL: https://github.com/apache/hadoop/pull/8953
## Problem - `ContainerSignalContext.equals()` mixes `&&` and `||` without grouping each field comparison. A later matching field can override an earlier mismatch, allowing contexts with different PIDs, signals, or containers to compare equal and become inconsistent with `hashCode()`. - The incorrect equality checks also mask invalid PID and container expectations in six `TestDefaultOOMHandler` tests. ## Solution - Compare PID, signal, container, and user with null-safe `Objects.equals()` checks joined by `&&`. Keep `hashCode()` unchanged. - Add `TestContainerSignalContext` coverage for equal contexts, individual field mismatches, null fields, unrelated object types, and equal-object hash codes. - Correct the expected PID/container pairs in the affected OOM tests. Leave OOM selection and signaling behavior unchanged. ## Validation - Local macOS 14.7.6, JDK 17.0.8, Maven Wrapper 3.9.15; no native profile. - Before the production fix, `TestContainerSignalContext` runs 7 tests with 3 failures, 0 errors, and 0 skipped. The failures cover different PIDs, signals, and containers. - With the complete fix: `TestContainerSignalContext` (7), `TestDefaultOOMHandler` (18), `TestContainerReapContext` (2), and `TestContainerCleanup` (3): 30 tests, 0 failures, 0 errors, 0 skipped. - Focused Checkstyle on all three changed files reports 5 violations in unchanged production code: one `JavadocPackage` and four `HiddenField` findings. Both test files have 0 violations. - Whitespace checks pass for the tracked changes and the new test file. - The full NodeManager test suite and community CI have not been run. ## Related Jira - [YARN-12059](https://issues.apache.org/jira/browse/YARN-12059) Contains content generated by Codex. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
