-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring of Server.h: Isolate server management from other logic #64132
Refactoring of Server.h: Isolate server management from other logic #64132
Conversation
This is an automated comment for commit 7a313e7 with description of existing statuses. It's updated for the latest CI running ❌ Click here to open a full report in a separate page
Successful checks
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, extracting and splitting the code into separate files makes sense if it was used by multiple places but this is not the case here. The only user of "InterServerManager" and "ProtocolServersManager" is Server.cpp. Things are IMHO easier to understand if everything is in one place. I would therefore prefer to not merge this PR (unless there is a good reason which I missed).
The idea behind the change was to aid the addition of new protocols - a relatively common improvement that should not require modifications of existing code. Currently, besides implementing the new logic, you would have to change Server.cpp, which is over 2500 lines of code - not the best experience. |
@TTPO100AJIEX Okay, fine with me then, thanks! The only problem I have at this point is that the PR mixes tons of unrelated formatting/cosmetic changes with actual refactorings (moved code). I am really not against formatting changes, but in order to make this reviewable and also revertable (<-- in case something goes wrong), we need to separate the signal from the noise. Therefore, it would be nice if you could rework the commit history (commit messages are at the moment trash anyways - excuse me, just stating the obvious), and make two commits: 1. with all formatting changes 2. the actual refactoring - then force-push and remove "[WIP]" from the PR title. |
f852eb5
to
f06e563
Compare
49b58f2
to
c940928
Compare
Co-authored-by: Alex Koledaev <ax3l3rator@gmail.com>
9979b85
to
251010f
Compare
@rschu1ze Could you please have a look at the PR? I have removed the styling changes and squashed the commits. There are some failed tests, but I do not understand how the changes could have affected them (especially the upgrade check). Is there a possibility those tests are inherently broken? Could you please clarify, what exactly those tests are checking? |
Checking now. I also restarted the failing tests (they are indeed unrelated). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! In general, the refactoring looks like it was done right though I did not step through the code or verify it further.
Please see my (mostly minor) comments, after adressing them we can merge.
@rschu1ze The CI has been completed. Some tests failed, but they seem unrelated to the changes again (and they are different from what had failed before). Could you please merge the PR as it is? |
79bcc54
@rschu1ze, some CI checks have not finished |
@tavplubix But aren't those checks just broken or flaky? Something fails for all PRs, and the changes do not seem to be related to the failed tests. |
@TTPO100AJIEX As you probably know, ClickHouse also maintains an internal repository and all "public" PRs are picked in the background into the non-public repo. In this case, there was a merge conflict in the non-public repository (as can be expected by such large refactorings) but I merged your PR yesterday without noticing. By bad, sorry. I'll do a revert of the revert soon and check/resolve these conflicts. |
I do think you guys should give a heads up about this kind of things to the community, otherwise it'll be impossible to contribute in a few months (when your fork diverges enough) |
Sorry for the delay, priorities got a bit disarranged for me this week. I'll definitely check today, promised. |
Logic to manage protocol servers is implemented in the global Server class, which is responsible for the "main" function. I find it reasonable to abstract this in a separate class responsible only for managing the list of servers to improve readability and code encapsulation.
Changelog category (leave one):