Skip to content

Conversation

@huskar-t
Copy link
Collaborator

Description

enh: refactor connection handling and improve logging

Jira: https://jira.taosdata.com:18080/browse/TS-7693

Checklist

Please check the items in the checklist if applicable.

  • Is the user manual updated?
  • Are the test cases passed and automated?
  • Is there no significant decrease in test coverage?

@huskar-t huskar-t marked this pull request as ready for review December 4, 2025 07:45
@huskar-t
Copy link
Collaborator Author

huskar-t commented Dec 4, 2025

/gemini review

@gemini-code-assist
Copy link

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@huskar-t
Copy link
Collaborator Author

huskar-t commented Dec 4, 2025

/gemini review

@gemini-code-assist
Copy link

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@huskar-t
Copy link
Collaborator Author

huskar-t commented Dec 8, 2025

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a major refactoring that simplifies the library by removing the API, CLI, and other application-level components to focus on the core OPC DA client functionality. It introduces structured logging with logrus and improves testing with testify. The connection handling is also enhanced with a more robust automatic reconnection logic. While these are great improvements, there are a few critical issues that need to be addressed. Specifically, there's a build-breaking issue due to the use of a function not available in the specified Go version, serious concurrency issues that could lead to race conditions, and the use of panic and Fatalf which is not ideal for a library.

@huskar-t
Copy link
Collaborator Author

huskar-t commented Dec 8, 2025

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a major refactoring that significantly improves the OPC connection handling and logging. The API and command-line tools have been removed to focus on the core library. The connection logic is now much more robust, with automatic reconnection and retry mechanisms. Logging has been standardized on logrus, and OLE resource management has been improved, fixing potential memory leaks. The tests have also been rewritten using testify for better assertions and now cover the new reconnection logic.

I've found a few critical issues where the library panics instead of returning errors, which could crash consumer applications. I've also noted a point in the tests where behavior is surprising and could benefit from a clarifying comment. Overall, this is a great enhancement, and addressing the identified issues will make the library even more robust and safe to use.

@zitsen zitsen merged commit 6a1e4c7 into master Dec 9, 2025
6 checks passed
@zitsen zitsen deleted the enh/xftan/TS-7693 branch December 9, 2025 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants