-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Closed
Labels
bugSomething isn't workingSomething isn't workingfixed in v1Issues addressed by the v1 betaIssues addressed by the v1 beta
Description
Describe the bug
This MAX_SESSION_LIFETIME_SECS setting kills sessions after 3 minutes. I believe this breaks long running tasks. It would also be difficult to troubleshoot downstream issues if the client is killing sessions at an arbitrary 3 minutes. Can someone verify the PR the brought this change is 100% good to go? It seems to me like this shouldn't be there, or at least be configurable, and that it would mess with users passing in sessions.
elif (
time.time() - getattr(_thread_context, "session_create_time", 0)
>= MAX_SESSION_LIFETIME_SECS
):
_thread_context.session.close()
_thread_context.session = _make_session()
_thread_context.session_create_time = time.time()
To Reproduce
Run a long running llm request, and a new session is created after 3 minutes during.
Code snippets
No response
OS
macOS
Python version
3.8
Library version
openai-python v0.28.0
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfixed in v1Issues addressed by the v1 betaIssues addressed by the v1 beta