You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
mscheong01
changed the title
Background threads are not cleaned up when using DefaultOkHttpOpenAiClient
Cannot close OkHttpClient when using DefaultOkHttpOpenAiClientJun 11, 2023
The cause turned out to be that the OkHttpClient used in DefaultOkHttpOpenAiClient is not closed, leaving connection threads that keep the application from exiting. We could make the OpenAiProxyFactory and OpenAiApiAdapter implement Closable. However, this would mean that closing an OpenAiProxyFactory would stop all proxies created from it from working. I'm not sure if this is an acceptable pattern 🤔
I've implemented the above comment here, but I'll leave it open until I'm sure that it's a good implementation
mscheong01
changed the title
Cannot close OkHttpClient when using DefaultOkHttpOpenAiClient
Provide a way to close OkHttpClient when using DefaultOkHttpOpenAiClientJun 11, 2023
When executing a Test where an error occurs in InvocationHandler, it takes a while for the system to exit after the exception is thrown. It looks like the probable cause is that the background thread that calls the openai api is not cleaned up and runs regardless of the error. This did not happen when I used
OpenAiApiClient
defined in the spring boot starter that uses a spring webclient.suspicious code:
https://github.com/mscheong01/interfAIce/blob/main/core/src/main/kotlin/io/github/mscheong01/interfaice/openai/DefaultOkHttpOpenAiClient.kt
The text was updated successfully, but these errors were encountered: