Skip to content

Conversation

leseb
Copy link
Contributor

@leseb leseb commented Apr 19, 2024

When we simply run ilab chat, a temporary server will run in the background and we can enjoy a great chat. However, if the chat response is interrupted with ctrl+C, the signal will be caught by uvicorn and then the server will be killed making further chat impossible and printing a large backtrace.

Another option was to run the temp server in a dedicated thread but this requires a bit more changes as well as the difficulty of handling the thread termination. This would have been handled by uvicorn natively since it is not setting up any signal handler but would still require us to handle it manually in our code.

Resolves: #883
Signed-off-by: Sébastien Han seb@redhat.com

@github-actions github-actions bot added the testing Relates to testing label Apr 19, 2024
When we simply run `ilab chat`, a temporary server will run in the
background and we can enjoy a great chat. However, if the chat
response is interrupted with ctrl+C, the signal will be caught by
uvicorn and then the server will be killed making further chat
impossible and printing a large backtrace.

Another option was to run the temp server in a dedicated thread but this
requires a bit more changes as well as the difficulty of handling the
thread termination. This would have been handled by uvicorn natively
since it is not setting up any signal handler but would still require
us to handle it manually in our code.

Signed-off-by: Sébastien Han <seb@redhat.com>
Copy link
Member

@russellb russellb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense to me - thanks for the fix!

@russellb russellb merged commit 1057c42 into instructlab:main Apr 23, 2024
@leseb leseb deleted the fix-sigint-on-temp-server branch April 23, 2024 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Relates to testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"ilab chat" temp server crashes on ctrl+C during response
2 participants