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(shutdown): do not shutdown immediately busy backends #3543

Merged
merged 3 commits into from
Sep 17, 2024

Conversation

mudler
Copy link
Owner

@mudler mudler commented Sep 14, 2024

Description

This PR tries to fix edge cases where we attempt to shutdown the model via Shutdown while the model is running and busy. It checks if the model is busy and waits before actually killing it.

@mudler mudler added the bug Something isn't working label Sep 14, 2024
Copy link

netlify bot commented Sep 14, 2024

Deploy Preview for localai ready!

Name Link
🔨 Latest commit ae86724
🔍 Latest deploy log https://app.netlify.com/sites/localai/deploys/66e8a5788c27dc000835b8f4
😎 Deploy Preview https://deploy-preview-3543--localai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@dave-gray101
Copy link
Collaborator

Looks good to me, but I'm not totally sure on the retry every two seconds part. Created a PR to modify that to i*2 seconds instead.

* multiplicative backoff for shutdown

Rather than always retry every two seconds, back off the shutdown attempt rate? 

Signed-off-by: Dave <[email protected]>

* Update loader.go

Signed-off-by: Dave <[email protected]>

* add clamp of 2 minutes

Signed-off-by: Dave Lee <[email protected]>

---------

Signed-off-by: Dave <[email protected]>
Signed-off-by: Dave Lee <[email protected]>
@dave-gray101 dave-gray101 enabled auto-merge (squash) September 17, 2024 03:17
@dave-gray101 dave-gray101 merged commit d0f2bf3 into master Sep 17, 2024
31 checks passed
@dave-gray101 dave-gray101 deleted the shutdown_busy branch September 17, 2024 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants