This repository was archived by the owner on Aug 12, 2020. It is now read-only.
critical fix to make callback_storage thread-safe#46
Open
githubmonkey wants to merge 6 commits intomstump:masterfrom
Open
critical fix to make callback_storage thread-safe#46githubmonkey wants to merge 6 commits intomstump:masterfrom
githubmonkey wants to merge 6 commits intomstump:masterfrom
Conversation
…is to highlight a potential bug inside libcql. As far as I know libcql is meant to be thread safe, but this demo shows otherwise. A bunch of concurrent calls to pool->query() inevitably result in an exception "The associated promise has been destructed prior to the associated state becoming ready." Hopefully, this will get the community interested in helping me debugging the demo and underlying libcql calls...
…overwrite each others callback functions. This fixes a critical bug reported in https://github.com/mstump/libcql/issues/44
Also reduce runtime and thread number to something more reasonable. This was exaggerated to demonstrate the bug but the problem has been addressed.
Contributor
|
Couple of comments about this:
I'll try to do some investigation next week. |
Contributor
|
Nevermind, I see it now. You are right, it is easier to make storage thread safe then to move stream_id allocation inside event loop. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi Matt,
feel free to discard the changes to demo/main.cpp as I used them mostly to demonstrate the bug.
I do recommend you pull the update to cql_callback_storage.hpp though as it fixes the race condition reported in #44.
Cheers!