You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-issues@hadoop.apache.org by "Jose Luis López (Jira)" <ji...@apache.org> on 2026/09/25 11:01:00 UTC

[jira] [Updated] (YARN-11993) PublicLocalizer thread exits permanently when pending.remove() returns null

     [ https://issues.apache.org/jira/browse/YARN-11993?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jose Luis López updated YARN-11993:
-----------------------------------
    Description: 
In ResourceLocalizationService$PublicLocalizer.run(), when pending.remove(completed)
returns null the loop logs "Localized unknown resource" and returns, terminating the
Public Localizer thread for the life of the NodeManager.

The NM itself stays up, so nothing marks the node unhealthy, but every subsequent
public localization fails with RejectedExecutionException and containers that need
public resources hang until the NM is restarted. That is the end state reported in
YARN-9968, which fixed a different branch in this class.

Expected: an unattributable localized resource is skipped and the localizer keeps
serving later requests.

The branch looks unreachable today - addResource() puts the submit and the map
update in one synchronized block for exactly this reason - but YARN-11746 proposes
shutting the NodeManager down when this thread exits, which would turn it from
silent degradation into a node-wide outage.

  was:
hadoop-yarn-server-nodemanager currently has one extant SpotBugs warning on
trunk, so Yetus votes -1 spotbugs on every PR whose module list includes
NodeManager, regardless of what the PR actually changes.

  NP_NULL_ON_SOME_PATH_EXCEPTION
  org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer
      .ResourceLocalizationService$PublicLocalizer.run()
  Value "assoc" dereferenced at line 997; null value at 986; known null at 987.

This is a false positive. "assoc" is only null on the path that logs
"Localized unknown resource" and returns early at line 989. The only source of
ExecutionException inside that try block is completed.get() at line 991, which
follows the early return -- FileUtil.getDU(File) and EventHandler.handle(T)
declare no checked exceptions. SpotBugs models exception paths conservatively
and treats the handler as reachable from the point where "assoc" is known null.

The warning is in fact already suppressed in
hadoop-yarn/dev-support/findbugs-exclude.xml, but the <Method> name has gone
stale:

  - HADOOP-19670 (2025-11-21) made PublicLocalizer extend
    SubjectInheritingThread, renaming run() to work().
  - YARN-11912 (2025-12-23) updated the filter from "run" to "work",
    which silenced the warning.
  - The revert of HADOOP-19668/19670 (2026-07-06, apache/hadoop#8568) restored
    run() in the Java but left the filter saying "work", so it now matches
    nothing and the warning is live again.

Fix: point the filter back at "run" and add a comment recording why the
suppression exists, so a future rename is less likely to silently break it.

Verified locally with:
  mvn -pl hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager \
      -DskipTests test-compile spotbugs:spotbugs
target/spotbugsXml.xml contains exactly one BugInstance before the change and
zero after.

        Summary: PublicLocalizer thread exits permanently when pending.remove() returns null  (was: Suppress false-positive in ResourceLocalizationService.PublicLocalizer.run())

> PublicLocalizer thread exits permanently when pending.remove() returns null
> ---------------------------------------------------------------------------
>
>                 Key: YARN-11993
>                 URL: https://issues.apache.org/jira/browse/YARN-11993
>             Project: Hadoop YARN
>          Issue Type: Bug
>          Components: nodemanager
>            Reporter: Jose Luis López
>            Priority: Minor
>              Labels: pull-request-available
>
> In ResourceLocalizationService$PublicLocalizer.run(), when pending.remove(completed)
> returns null the loop logs "Localized unknown resource" and returns, terminating the
> Public Localizer thread for the life of the NodeManager.
> The NM itself stays up, so nothing marks the node unhealthy, but every subsequent
> public localization fails with RejectedExecutionException and containers that need
> public resources hang until the NM is restarted. That is the end state reported in
> YARN-9968, which fixed a different branch in this class.
> Expected: an unattributable localized resource is skipped and the localizer keeps
> serving later requests.
> The branch looks unreachable today - addResource() puts the submit and the map
> update in one synchronized block for exactly this reason - but YARN-11746 proposes
> shutting the NodeManager down when this thread exits, which would turn it from
> silent degradation into a node-wide outage.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org