smengcl opened a new pull request, #11246: URL: https://github.com/apache/ozone/pull/11246
## What changes were proposed in this pull request? Datanode startup can hang indefinitely when container initialization fails, for example because a corrupted Raft log cannot be read. `OzoneContainer.start()` already propagates the startup exception, but the existing failure handling has several gaps: - Initialization remains `INITIALIZING`, leaving subsequent callers waiting indefinitely for `INITIALIZED`. - `VersionEndpointTask` does not treat runtime exceptions from initialization as fatal startup failures. - If the caller has already timed out, the exceptional task completion can go unobserved. Proposed changes: - Log the full cause and trigger datanode shutdown for local initialization failures. Partially started services cannot safely be initialized again because startup is not idempotent. SCM communication failures remain retryable. - Retain `InitializingStatus` and add `FAILED`, preserving the original exception so waiting and subsequent callers fail promptly without repeating initialization. - Preserve pending endpoint completions across heartbeat cycles and make endpoint state changes visible across threads, allowing delayed failures to trigger shutdown. - Serialize initialization using a separate lock so container reporting remains available during startup. ## What is the link to the Apache JIRA? [HDDS-16425](https://issues.apache.org/jira/browse/HDDS-16425) ## How was this patch tested? - All 46 tests passed across `TestOzoneContainer`, `TestRunningDatanodeState`, and `TestDatanodeStateMachine`. - Coverage includes concurrent initialization, checked and unchecked failures, late completions, slow successful startup, and retryable SCM communication failures. - An integrated test injects a delayed Ratis startup failure after replication starts, verifying original-cause logging, the fatal shutdown callback, waiting-caller release, and no initialization retry. - Checkstyle passed. Generated-by: Codex (GPT-6) -- 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]
