Skip to content

There is a thread safety issue with InfluxDBResultMapper #683

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

Closed
mayuefeng777 opened this issue Jun 15, 2020 · 1 comment · Fixed by #685
Closed

There is a thread safety issue with InfluxDBResultMapper #683

mayuefeng777 opened this issue Jun 15, 2020 · 1 comment · Fixed by #685
Labels

Comments

@mayuefeng777
Copy link
Contributor

When I run the toPOJO method from the InfluxDBResultMapper in a multithreaded environment, some fields of the objects returned are null in some special cases.

Then I debugged and figured out that there is some problem in the cacheMeasurementClass method. When the first thread puts the measurement class into the cache map CLASS_FIELD_CACHE and before it finish putting all the field of the measurement class into cache, other threads would get an incomplete cache object.

I think it‘s better to make it synchronized or move the step of putting the measurement class into the cache map to the end, at least after all the field of the measurement class cached.

@russorat
Copy link

@mayuefeng777 thanks for the report. Are you interested in opening a PR?

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

Successfully merging a pull request may close this issue.

2 participants