You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Ivan Andika (Jira)" <ji...@apache.org> on 2026/10/23 07:57:00 UTC

[jira] [Created] (HDDS-17378) DatanodeStateMachine is not properly constructed

Ivan Andika created HDDS-17378:
----------------------------------

             Summary: DatanodeStateMachine is not properly constructed
                 Key: HDDS-17378
                 URL: https://issues.apache.org/jira/browse/HDDS-17378
             Project: Apache Ozone
          Issue Type: Bug
            Reporter: Ivan Andika
            Assignee: Ivan Andika


DatanodeStateMachine "this" reference escapes during its construction. See the following implementation below
{code:java}
context = new StateContext(this.conf, DatanodeStates.getInitState(), this,
        threadNamePrefix);
{code}
From "Java Concurrency in Practice", this means the DatanodeStateMachine is {_}not properly constructed{_}.

See the excerpt: "An object is in a predictable, consistent state only after its constructor returns, so publishing an object from within its constructor can publish an incompletely constructed object"

And the exact imperative "Do not allow the `this` reference to escape during construction"

This issue seems to cause the workaround of having constructionLock in HDDS-3116.

This can be improved.

 



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

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