influxdata / influxdata/influxdb-java
InfluxDBException: 'error parsing query' - Error is not propagated to Consumer callback
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.2k
- Forks
- 469
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
please take a look at InfluxDBImpl.java#L548
If you throw an InfluxDBException an this position, it is not possible to catch it on the caller side:
public void loadDataAsync(int chunk, Consumer<QueryResult> consumer) {
// Bad syntax test
db.query(new Query("SELECT * FROM sieries LIMIT -100", databaseName), chunk, consumer);
}
Stacktrace:
org.influxdb.InfluxDBException: {"error":"error parsing query: found -, expected integer at line 1, char 63"}
at org.influxdb.impl.InfluxDBImpl$1.onResponse(InfluxDBImpl.java:420)
at retrofit2.OkHttpCall$1.callSuccess(OkHttpCall.java:138)
at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:117)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:141)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
This causes my REST-Endpoint (Spring MVC) to hang.

Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/main/java/org/influxdb/impl/InfluxDBImpl.java around the referenced line and trace the asynchronous query response handling shown in the stack trace. Reproduce the invalid-query case, then verify that the Consumer callback receives the error and the calling REST endpoint no longer hangs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100