Thanks to visit codestin.com
Credit goes to github.com

Skip to content

There is a thread safety issue with InfluxDBResultMapper #683

@mayuefeng777

Description

@mayuefeng777

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions