Skip to content
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

Fixes #235 : concurrency bug in FSTStreamDecoder/FSTStreamEncoder #254

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrewl102
Copy link

The current implementation of the cache within these classes is not thread safe, as seen by #235 and the test case I have attached to that issue.

This might potentially have some negative performance implications but overall given the severity of the bug, I believe correctness might be more important.
Proper synchronization or protection against these fields is likely possible but beyond my current understand of the codebase, as the code involved for this is quite complex.

@RuedigerMoeller
Copy link
Owner

well, this has a major performance draw back, will try using Atomic locks or so

@perlun
Copy link

perlun commented Jan 24, 2019

@RuedigerMoeller Any idea of when you anticipate to have time to look into this further?

@RuedigerMoeller
Copy link
Owner

RuedigerMoeller commented May 17, 2020

will have to do performance tests before merging. fst is not thread save by intent, its just too costly in high performance use cases. Even introducing some allocations on hotspot has measurable impact.

@winrid
Copy link

winrid commented May 8, 2022

@RuedigerMoeller is this still an issue? It looks like in the docs FSTConfiguration is meant to be thread safe. Is that not the case?

@perlun
Copy link

perlun commented May 13, 2022

@winrid Don't know the details about this particular bug, but see also #270 and #274 for some concurrency-related issues. We ended up moving away from FST since we couldn't get it to be stable enough for our use case. 😢

@winrid
Copy link

winrid commented May 13, 2022

@perlun Thanks. Yeah it looks like a really cool project, but it's a tough problem :)

We ended up just hand rolling the serialization stuff for now because I couldn't find anything that satisfied all our requirements. Also it's a game and we are really counting bytes...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants