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

fix: 4155 - Queue up health check on server restarting #4201

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

louis-jan
Copy link
Contributor

Describe Your Changes

  • This fixes the issue where users force-kill the Cortex process in Windows Task Manager and immediately try to send a message in Jan's UI, they receive a "failed to fetch" error. This indicates that Jan is not gracefully handling cases where the Cortex process is terminated unexpectedly.

CleanShot 2024-12-03 at 16 16 25

Fixes Issues

Changes made

The code modification introduces several updates within the onclose event handler for a WebSocket connection:

  1. Comment Addition: A comment explaining the server segfault issue handling has been added.

  2. Event Emission: Before attempting to reconnect, the code now emits a ModelEvent.OnModelStopped event to notify the application about a model's stopped state.

  3. Health Check: After attempting to reconnect, the code queues up a health check call (this.healthz()) using the this.queue mechanism to ensure the system's health is verified.

@louis-jan louis-jan requested a review from a team December 3, 2024 09:18
@github-actions github-actions bot added the type: bug Something isn't working label Dec 3, 2024
Copy link
Contributor

github-actions bot commented Dec 3, 2024

Barecheck - Code coverage report

Total: 69.32%

Your code coverage diff: 0.00% ▴

✅ All code changes are covered

@louis-jan louis-jan merged commit 9e634c7 into dev Dec 3, 2024
11 checks passed
@louis-jan louis-jan deleted the fix/4155-queue-up-health-check-on-server-restart branch December 3, 2024 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants