Skip to content

Conversation

@mahou-shoujo
Copy link

Hello, I have the same problem as reported in #568 (while using /api/extra/generate/stream). The easiest way to reproduce this behavior is by starting a streaming connection and then simply dropping it, for example

timeout 2s curl --request POST \
  --url http:/localhost:5001/api/extra/generate/stream \
  --header 'Content-Type: application/json' \
  --data '{ "prompt": "Niko the kobold stalked carefully down the alley, his small scaly figure obscured by a dusky cloak that fluttered lightly in the cold winter breeze." }'

Starting a new connection will then cause a crash.

One way to fix this is by handling BrokenPipeError. There is already a code for handling ConnectionAbortedError and I have tried to trigger it (without explicitly closing connection on a client) but failed. It's not entirely clear to me what is the difference between the two, however handling BrokenPipeError in the same way as ConnectionAbortedError does fix the problem.

@LostRuins LostRuins changed the base branch from concedo to concedo_experimental December 21, 2023 09:51
Copy link
Owner

@LostRuins LostRuins left a comment

Choose a reason for hiding this comment

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

lgtm

@LostRuins LostRuins merged commit a787ebe into LostRuins:concedo_experimental Dec 21, 2023
Nexesenex added a commit to Nexesenex/croco.cpp that referenced this pull request Dec 21, 2023
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

Successfully merging this pull request may close these issues.

2 participants