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

Fields sometimes null after retrieving QueryResult from InfluxDB #733

Open
bennycwlau opened this issue Mar 30, 2021 · 2 comments
Open

Fields sometimes null after retrieving QueryResult from InfluxDB #733

bennycwlau opened this issue Mar 30, 2021 · 2 comments

Comments

@bennycwlau
Copy link

bennycwlau commented Mar 30, 2021

Most of the time I'm able to successfully query my InfluxDB and convert the result to POJO without any issue. However, sometimes after getting the QueryResult , some of the property fields, for my object, in the QueryResult are null even though none of the fields are null/empty for that record in my InfluxDB measurement. This only happens to a few of the property fields too, not all of them. Why does this happen?

My Spring Boot application also receives many concurrent requests at any given moment, which makes me think this may be a multi-threading issue. Also my class has a @Data Lombok annotation if that is relevant during the POJO conversion. So far, a temporary solution is refetching the QueryResults a second time. During this second time, the fields are no longer null. I included an example below for my Transaction measurement and class/POJO

Transaction measurement (in InfluxDB)
Time: 1612283422708733547
Amount: 18.20
Status: Success

POJO (in Spring Boot application after resultMapper.toPOJO)
Time: 1612283422708733547
Amount: null
Status: null

Current logic in application

Query query = new Query(String.format(queryString, lastTimestamp), "transaction");
QueryResult queryResult = influxDB.query(query);
return resultMapper.toPOJO(queryResult, Transaction.class, TimeUnit.NANOSECONDS);

InfluxDB version: 1.8.3

Could this be related to #676 or #693 or #683 ?

@bennycwlau bennycwlau changed the title Fields sometimes null after retrieving QueryResult from InfluxDB and conversion to POJO Fields sometimes null after retrieving QueryResult from InfluxDB Mar 30, 2021
@bennycwlau
Copy link
Author

@majst01 Any ideas?

@majst01
Copy link
Collaborator

majst01 commented Apr 1, 2021

No, is suspect a concurrency issue in some way. We had never this type of error in the past.
You can enable debug logging and see where the data is lost.

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

No branches or pull requests

2 participants