dosubot[bot] commented on issue #2867: URL: https://github.com/apache/incubator-hugegraph/issues/2867#issuecomment-3251634418
<!-- Answer --> You are correct—there is a bug in the RaftEngine.getState method: it uses reflection to access the private state field of a Replicator object, but incorrectly calls f.get(this.raftNode) instead of f.get(r). This means it tries to get the state field from the raftNode instance (which is a Node), not from the Replicator instance passed as the parameter, which is almost certainly not intended and could cause incorrect behavior or exceptions if the types do not match. There are no comments or documentation justifying this usage, so it appears to be an oversight and should be fixed by replacing this.raftNode with r in the reflection call. No related fixes or discussions were found in recent pull requests or issues, so this is likely still present in the current codebase [(source)](https://github.com/apache/incubator-hugegraph/blob/a53af864b31f803780a1db31cb20d3d94d5d34fc/hugegraph-pd/hg-pd-core/src/main/java/org/apache/hugegraph/pd/raft/RaftEngine.java). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/b3c51d5f-55b6-421d-ad7c-b63526ed8209?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/b3c51d5f-55b6-421d-ad7c-b63526ed8209?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/b3c51d5f-55b6-421d-ad7c-b63526ed8209?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/b3c51d5f-55b6-421d-ad7c-b63526ed8209?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/b3c51d5f-55b6-421d-ad7c-b63526ed8209?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/b3c51d5f-55b6-421d-ad7c-b63526ed8209?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/b3c51d5f-55b6-421d-ad7c-b63526ed8209?feedback_type=other)</sup> [](https://app.dosu.dev/e5e246fa-a522-4d8a-ab3c-e2588b5b501b/ask?utm_source=githu b) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/incubator-hugegraph/issues/2867) -- 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: issues-unsubscr...@hugegraph.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@hugegraph.apache.org For additional commands, e-mail: issues-h...@hugegraph.apache.org