[
https://issues.apache.org/jira/browse/YARN-12059?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Cheng Pan resolved YARN-12059.
------------------------------
Fix Version/s: 3.4.4
3.5.1
3.6.0
Resolution: Fixed
> Fix equality checks in ContainerSignalContext
> ---------------------------------------------
>
> Key: YARN-12059
> URL: https://issues.apache.org/jira/browse/YARN-12059
> Project: Hadoop YARN
> Issue Type: Bug
> Components: nodemanager
> Reporter: Yuan Luo
> Assignee: Yuan Luo
> Priority: Minor
> Labels: pull-request-available
> Fix For: 3.4.4, 3.5.1, 3.6.0
>
>
> h2. 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.
> h2. 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.
> h2. 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.
> * Community Jenkins/Yetus passed. GitHub Actions reports a failed Notify Test
> Workflow check and a neutral Build check.
> h2. Related PR
> * [PR #8953|https://github.com/apache/hadoop/pull/8953]
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]