Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the Chat UI, pressing stop throws a lot of exceptions in the console #69

Open
zspitzer opened this issue Oct 15, 2024 · 1 comment

Comments

@zspitzer
Copy link

When streaming a response, pressing the stop button results in a whole lot of console exceptions

2024-10-15T16:28:27.789+02:00 ERROR 16640 --- [nPool-worker-23] c.g.tjake.jlama.model.AbstractModel      : Failed to decode token 69099

java.lang.IllegalStateException: ResponseBodyEmitter has already completed with error: org.springframework.web.context.request.async.AsyncRequestNotUsableException: ServletOutputStream failed to flush: An established connection was aborted by the software in your host machine
        at org.springframework.util.Assert.state(Assert.java:97) ~[spring-core-6.1.9.jar:6.1.9]
        at org.springframework.web.servlet.mvc.method.annotation.ResponseBodyEmitter.send(ResponseBodyEmitter.java:212) ~[spring-webmvc-6.1.11.jar:6.1.11]
        at org.springframework.web.servlet.mvc.method.annotation.SseEmitter.send(SseEmitter.java:135) ~[spring-webmvc-6.1.11.jar:6.1.11]
        at org.springframework.web.servlet.mvc.method.annotation.SseEmitter.send(SseEmitter.java:118) ~[spring-webmvc-6.1.11.jar:6.1.11]
        at org.springframework.web.servlet.mvc.method.annotation.SseEmitter.send(SseEmitter.java:99) ~[spring-webmvc-6.1.11.jar:6.1.11]
        at com.github.tjake.jlama.net.openai.OpenAIChatService.lambda$createChatCompletion$0(OpenAIChatService.java:112) ~[jlama-net-0.5.1.jar:na]
        at com.github.tjake.jlama.model.AbstractModel.generate(AbstractModel.java:494) ~[jlama-core-0.5.1.jar:na]
        at com.github.tjake.jlama.net.openai.OpenAIChatService.lambda$createChatCompletion$1(OpenAIChatService.java:110) ~[jlama-net-0.5.1.jar:na]
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760) ~[na:na]
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387) ~[na:na]
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312) ~[na:na]
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843) ~[na:na]
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808) ~[na:na]
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188) ~[na:na]
@tjake
Copy link
Owner

tjake commented Oct 15, 2024

Yes Ive noticed this, just need to check if Sse emitter is closed

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

No branches or pull requests

2 participants