File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
operator/src/main/java/oracle/kubernetes/operator/helpers Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,13 @@ private ApiClient getApiClient() {
85
85
return client ;
86
86
}
87
87
88
+ @ Override
89
+ protected ApiClient onRecycle (ApiClient instance ) {
90
+ // Work around async processing creating, but not cleaning-up network interceptors
91
+ instance .getHttpClient ().networkInterceptors ().clear ();
92
+ return super .onRecycle (instance );
93
+ }
94
+
88
95
private static class DefaultClientFactory implements ClientFactory {
89
96
private final AtomicBoolean first = new AtomicBoolean (true );
90
97
Original file line number Diff line number Diff line change @@ -46,12 +46,16 @@ protected Queue<T> getQueue() {
46
46
* @param instance Pool object to recycle
47
47
*/
48
48
public final void recycle (T instance ) {
49
- getQueue ().offer (instance );
49
+ getQueue ().offer (onRecycle ( instance ) );
50
50
if (LOGGER .isFinerEnabled ()) {
51
51
LOGGER .finer ("Recycling instance to pool, instances now in pool: " + getQueue ().size ());
52
52
}
53
53
}
54
54
55
+ protected T onRecycle (T instance ) {
56
+ return instance ;
57
+ }
58
+
55
59
/**
56
60
* Creates a new instance of object. This method is used when someone wants to {@link #take()
57
61
* take} an object from an empty pool. Also note that multiple threads may call this method
You can’t perform that action at this time.
0 commit comments