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

Unbounded network interceptor chain in CustomObjectsApi class #707

Closed
tbak opened this issue Sep 19, 2019 · 3 comments
Closed

Unbounded network interceptor chain in CustomObjectsApi class #707

tbak opened this issue Sep 19, 2019 · 3 comments

Comments

@tbak
Copy link

tbak commented Sep 19, 2019

On each invocation of io.kubernetes.client.apis.CustomObjectsApi#replaceNamespacedCustomObjectCall(...), a new com.squareup.okhttp.Interceptor
instance is appended, which results in every growing interceptor list, which eventually leads to StackOverflowError.
This problem exists in all methods in CustomObjectsApi class which include the following code snippet:

        if(progressListener != null) {
            apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
                @Override
                public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                    com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                    return originalResponse.newBuilder()
                    .body(new ProgressResponseBody(originalResponse.body(), progressListener))
                    .build();
                }
            });
        }
        
@tbak
Copy link
Author

tbak commented Sep 19, 2019

I have missed that this issue was already reported here: #482. Any chance it will be fixed soon?

@tbak tbak closed this as completed Sep 19, 2019
@yue9944882
Copy link
Member

we're getting this by #595 (probably this month or next), but the pull will break backward-compatibility in some way, we have to evaluate carefully..

@tbak
Copy link
Author

tbak commented Sep 20, 2019

@yue9944882 If I can help in any way, please let me know.

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