SSH interface with PTY#48902
Conversation
c02f767 to
572c17b
Compare
572c17b to
0af463d
Compare
|
This is an automated comment for commit 32d1c06 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
|
e3c09d2 to
2d7ff44
Compare
888573b to
d431854
Compare
4026e62 to
4f028f4
Compare
4f028f4 to
019f5f5
Compare
antonio2368
left a comment
There was a problem hiding this comment.
A lot of changes!
there are a lot of comments but the majority of them are just code-style comments and general C++ rules for our repo.
Please go through https://clickhouse.com/docs/en/development/style and apply fixes where necessary.
6ef2e11 to
a675f2b
Compare
| int out_fd_, | ||
| int err_fd_) | ||
| : LineReader(history_file_path_, multiline_, std::move(extenders_), std::move(delimiters_), input_stream_, output_stream_, in_fd_) | ||
| , rx(input_stream_, output_stream_, in_fd_, out_fd_, err_fd_) |
There was a problem hiding this comment.
this will not work untill replxx is patched
|
I see that The TSAN failure looks related. Looking. |
|
Stateless tests (asan) - #74287 |
|
So, another iteration:
Given that these changes tend to conflict much, I will override the |
| return ssh_key_type_to_char(ssh_key_type(key)); | ||
| } | ||
|
|
||
| void SSHKey::setNeedsDeallocation(bool needs_deallocation_) |
There was a problem hiding this comment.
SSH key is a duplicate of src/SSH/SSHPublicKey. Further refactoring should remove this
| LOG_TRACE(log, "TCP Request. Address: {}", socket.peerAddress().toString()); | ||
| ::ssh::libsshLogger::initialize(); | ||
| ::ssh::SSHSession session; | ||
| session.disableSocketOwning(); |
There was a problem hiding this comment.
for this I remember writing a monkey test that will run session and abrupt session 100 times - then double free happens. It might have been deleted. This is important since when I was making a poc libssh owns socket and will free it out without this patch InfJoker/libssh-clickhouse-patch@11289d6
| /// NOP. The embedded client runs inside the server process which has its own signal handlers. | ||
| /// Thus we cannot override it in any way. | ||
| void setupSignalHandler() override {} |
There was a problem hiding this comment.
@nikitamikhaylov for this ClientBase has a method
ClickHouse/src/Client/ClientBase.h
Line 102 in e9c7f51
But since we can't setup signal handlers in a single process with database -> we should process charecters in SSHPtyHandler and if Ctrl-C is intercepted -> stop current query by calling mentioned method in ClientBase.
Or the other way around it is to spawn client in different process and figure out a way to talk with db back and forth
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
SSH interface has been added. It is now possible to connect to the ClickHouse server using any SSH client and execute queries in an interactive fashion using PTY with an embedded clickhouse-client.
Documentation entry for user-facing changes
CI Settings (Only check the boxes if you know what you are doing)
All builds in Builds_1 and Builds_2 stages are always mandatory
and will run independently of the checks below: