-
Notifications
You must be signed in to change notification settings - Fork 124
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
scylla-proxy: Add option to filter out control connection messages #863
Conversation
I'll try to add some test of this feature |
f18588b
to
edce2a4
Compare
I added a test. |
There is no way to filter out Execute messages like we can with Query messages, so if there are some sent by the driver itself (which will start happening soon) we can't reliably perform tests using proxy. This commit implements a heuristic way to filter out control connection messages. The idea is that only control connection registers to CQL Events, so we can skip connections that issued any registration message.
edce2a4
to
d3313e2
Compare
@@ -31,3 +31,4 @@ rand = "0.8.5" | |||
assert_matches = "1.5.0" | |||
ntest = "0.9.0" | |||
tracing-subscriber = { version = "0.3.14", features = ["env-filter"] } | |||
|
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.
The last commit adds nothing useful to scylla-proxy
, only an empty line.
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.
Fixed
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.
As for the reason why it used to work: I suppose that Cargo resolves dependencies for all crates in the workspace at once, and some other crate than scylla-proxy depends on tokio and enables the "signal" feature.
Strange; I know that we now sometimes prepare statements in case of |
This failing test can't be result of my changes, can it? It doesn't use proxy and I didn't touch scylla crate apart from 2 other tests. |
Some examples in scylla-proxy use tokio::signal, but this feature is not enabled in dependencies, and this prevents running cargo test in scylla-proxy directory. For some reason cargo test works when run in workspace, I'm not sure why that is the case.
d3313e2
to
7092296
Compare
I agree that it isn't related to the PR, no need to fix it here. Please create an issue about this failure. |
Opened: #864 |
Proxy does not allow filtering of control connection messages. Right now this is not a problem, as all queries performed by driver are not prepared, so tests can filter them out by checking query content.
The ongoing serialization refactor changes that and prepares some queries performed automatically by driver, which breaks some tests, as they are not able to differentiate test's queries from internal driver queries.
This PR adds a mechanism to filter out control connection messages by ignoring messages on connections that had any event registered. Control connection is the only one in rust driver that does it, so this should by a reliable heuristic.
Pre-review checklist
./docs/source/
.Fixes:
annotations to PR description.