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

java.lang.StackOverflowError:okhttp3 #379

Closed
i-xiaobao opened this issue Oct 27, 2017 · 3 comments
Closed

java.lang.StackOverflowError:okhttp3 #379

i-xiaobao opened this issue Oct 27, 2017 · 3 comments

Comments

@i-xiaobao
Copy link

i-xiaobao commented Oct 27, 2017

Single instance influxdb connections query a large amount of data, memory explosion occurs, when I try to establish a new query influxdb query data each time, or memory overflow occurs.

java.lang.StackOverflowError
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
	org.influxdb.impl.GzipRequestInterceptor.intercept(GzipRequestInterceptor.java:48)
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
	okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:144)
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
	org.influxdb.impl.GzipRequestInterceptor.intercept(GzipRequestInterceptor.java:48)
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
	okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:144)
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
	org.influxdb.impl.GzipRequestInterceptor.intercept(GzipRequestInterceptor.java:48)
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
	okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:144)
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
	org.influxdb.impl.GzipRequestInterceptor.intercept(GzipRequestInterceptor.java:48)
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
	okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:144)
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
	org.influxdb.impl.GzipRequestInterceptor.intercept(GzipRequestInterceptor.java:48)
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
	okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:144)
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
	org.influxdb.impl.GzipRequestInterceptor.intercept(GzipRequestInterceptor.java:48)
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
	okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:144)
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
	org.influxdb.impl.GzipRequestInterceptor.intercept(GzipRequestInterceptor.java:48)
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
	okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
	okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:144)
@majst01
Copy link
Collaborator

majst01 commented Oct 27, 2017

At least version of influxdb-java and the code which triggers this is required.

@i-xiaobao
Copy link
Author

i-xiaobao commented Oct 31, 2017

I'm a new programmer, and I don't know much about influxdb。

  • The dependency information of POM is:
    <dependency> <groupId>org.influxdb</groupId> <artifactId>influxdb-java</artifactId> <version>2.7</version> </dependency>

  • The influxdb I'm using is version 1.3

  • Here is the Java code I wrote:

      public void getData(){

        StringBuffer command = new StringBuffer();
        ..........
		OkHttpClient.Builder builder = new OkHttpClient.Builder().readTimeout(100, TimeUnit.SECONDS);
        InfluxDB influxDB_query = InfluxDBFactory.connect("http://192.168.1.86:8086", "XXX", "XXX",builder);
        influxDB_query.setDatabase(dbName);
        influxDB_query.enableGzip();
		
        QueryResult qr = influxDB_query.query(new Query(command.toString(), dbName),TimeUnit.MILLISECONDS);
        List<QueryResult.Result> res = qr.getResults();

        if(res.get(0).getSeries() != null) {
            QueryResult.Series series = res.get(0).getSeries().get(0);
            List<List<Object>> values = series.getValues();
            ..........
        }
        influxDB_query.close();
		
    }

@fmachado
Copy link
Contributor

fmachado commented Nov 7, 2017

@bbamber there are a couple of things that I would like to suggest you:

Now for the specific issue reported here, I cannot reproduce it. Could you please enable a more verbose logging by adding influxDB_query.setLogLevel(LogLevel.FULL); after influxDB_query.enableGzip(); ? Also, are you behind some kind of HTTP proxy?

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

No branches or pull requests

3 participants