adoroszlai opened a new pull request, #5474:
URL: https://github.com/apache/ozone/pull/5474
## What changes were proposed in this pull request?
Various OM background services can encounter NPE after shutdown:
```
[omNode-3-KeyDeletingService#0] WARN utils.BackgroundService
(BackgroundService.java:lambda$run$0(145)) - Background task execution failed
java.lang.NullPointerException
at
org.apache.hadoop.ozone.om.OzoneManager.isLeaderReady(OzoneManager.java:4068)
at
org.apache.hadoop.ozone.om.service.DirectoryDeletingService.shouldRun(DirectoryDeletingService.java:110)
at
org.apache.hadoop.ozone.om.service.DirectoryDeletingService.access$0(DirectoryDeletingService.java:105)
at
org.apache.hadoop.ozone.om.service.DirectoryDeletingService$DirDeletingTask.call(DirectoryDeletingService.java:145)
at
org.apache.hadoop.hdds.utils.BackgroundService$PeriodicalTask.lambda$run$0(BackgroundService.java:140)
```
This happens mostly in integration tests that restart OM. The problem is
that these background services are stopped only after OM Ratis server is
stopped and unset.
Instead of reordering steps of `stop()`, this PR proposes to fix this by
treating unset OM Ratis server as "leader not ready".
Also fix mismatch of service name in `DirectoryDeletingService`.
https://issues.apache.org/jira/browse/HDDS-9519
## How was this patch tested?
Ran `TestOzoneManagerHAMetadataOnly`, verified NPE is no longer present in
the logs.
CI:
https://github.com/adoroszlai/hadoop-ozone/actions/runs/6596116067
--
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]