-
Notifications
You must be signed in to change notification settings - Fork 11
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
future: cass future wait timed #147
Conversation
cae738d
to
b39f13e
Compare
b39f13e
to
8a365a4
Compare
8a365a4
to
06bd6b4
Compare
Rebased on master. |
06bd6b4
to
f188cd3
Compare
The async test I enabled started to fail (even when I only rebased on master). I can't reproduce it locally:
I'll update an integration test to make use of |
I changed
Link to the job: https://github.com/scylladb/cpp-rust-driver/actions/runs/10201719963/job/28224244570?pr=153#step:7:8477. Recently, we merged a PR that sets a default client timeout to I'll try to investigate further, but it seems that the test failure is not related to cc: @Lorak-mmk @wprzytula |
What is the error? also we should update to newer version / test with more than 1 version.
|
So previously there was no client request timeout at all? And now that you introduced it, queries are timing out? |
Good thing that you noticed that. I missed it. Indeed, when I run the tests locally under valgrind, the timeouts appear. |
Nvm, it's not ccm issue. I was just missing
What version would you suggest? 5.4.8? |
I recommend using ccm by nix, it removed a lot of my frustrations with ccm.
6.0 |
8b01a95
to
9e8978d
Compare
v2: addressed review comments There are still timeouts appearing. The conclusion is that the timeouts appear due to tests being run under
I think the former approach is better, as it allows us to test |
9e8978d
to
5cc1ba3
Compare
In second approach, if you use wait instead of wait_timed, then how does it test wait_timed? |
That's the point - it does not. That's why I prefer to run this specific test without valgrind. |
Sorry, I misread your message. |
v3: running the failing async test in a separate CI step without valgrind I'll update Scylla version in CI in a separate PR. |
5cc1ba3
to
2edd845
Compare
v3.1: deduplicate error message variable in callback test |
2edd845
to
9fcd2d8
Compare
v3.2: fix CI step description for timeout-sensitive cassandra integration tests |
383d574
to
0202780
Compare
Rebased on master |
0202780
to
869da67
Compare
v4: added proper synchronization between |
053c2b3
to
c58ff91
Compare
c58ff91
to
bb649a9
Compare
v4.1:
|
README.md
Outdated
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.
Comment regarding commit future: cass_future_wait_timed
:
It says Next commit will fix that,
, but the next commit is cargo: add futures 0.3 dependency. The commit after that is the one that fixes the problem.
pub(self) is equivalent to not providing a visibility specifier at all.
Note: this implementation does not work for `current-thread` tokio runtime in some cases, causing a deadlock. Two following commits will introduces changes which fix that. We will introduce a synchronization between `cass_future_wait` and `cass_future_wait_timed` callers.
Previously, there was a scenario when using `current-thread` tokio runtime, that caused the deadlock. The scenario described: ``` - we make use of a `current-thread` tokio runtime (`Builder::new_current_thread().enable_all().build()`) - we create a future which sleeps, let's say, 2s and then sets the value - we call `cass_future_wait_timed` on this future, with a timeout 1s. This consumes the handle, starts the future, times out after 1s (there is still a task to be polled until completion - the future from above which sets the value) - now we call `cass_future_wait` on the same future. This waits on cond variable (blocking operation). Now current thread is blocked, it is waiting (on a cond variable) for a value to be set. But there is noone to poll the future that sets the value, since we are using a `current-thread` runtime - deadlock... ``` This commit fixes that, preventing such scenario from happening. Co-authored-by: Karol Baryła <[email protected]>
This test needs to be run without valgrind, as it causes the client request timeouts to appear.
bb649a9
to
e0beb15
Compare
v4.2:
|
ref: #42
This PR implements a
cass_future_wait_timed
API function which allows to wait for a future to resolve within a given period of time.Pre-review checklist
.github/workflows/build.yml
ingtest_filter
..github/workflows/cassandra.yml
ingtest_filter
.