fix: check connection status in request#2303
Merged
frankiejol merged 2 commits intomainfrom Mar 13, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to avoid rvd_back --hibernate/--shutdown --disconnected crashing while checking client connection status by moving the connection refresh into a backend refresh_machine request and then reading the refreshed status from a readonly Ravada::Front::Domain object.
Changes:
- Reworks
_verify_connectionto enqueueRavada::Request->refresh_machine(...)and then checkclient_status()viaRavada::Front::Domain. - Updates disconnected-domain selection to use
list_domains_data+Ravada::Front::Domain->open(...)and removes the old helper. - Adds
can_hybernatetoRavada::Front::Domain::KVMto align front-domain capability reporting with backend KVM.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| script/rvd_back | Moves connection verification to a refresh_machine request, switches disconnected filtering to readonly front domains, and tweaks request-wait output. |
| lib/Ravada/Front/Domain/KVM.pm | Exposes can_hybernate for front KVM domains. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| uid => Ravada::Utils::user_daemon->id | ||
| ,id_domain => $domain->id | ||
| ); | ||
| _wait_request($req); |
| if ($req->error) { | ||
| warn $req->error."\n"; | ||
| } | ||
| print "\n\t".$req->output if $req->output; |
Comment on lines
1127
to
1135
| || ( $disconnected && $domain->is_active | ||
| && !$domain->autostart | ||
| && _client_status($domain) eq 'disconnected') | ||
| && $domain->client_status() eq 'disconnected') | ||
| ) { | ||
|
|
||
| delete $name{$domain->name}; | ||
| if ( $disconnected && $domain->client_status() eq 'disconnected') { | ||
| if ( $disconnected ) { | ||
| next if $domain->client_status() ne 'disconnected'; | ||
| next if _verify_connection($domain); |
Comment on lines
+822
to
+825
| _wait_request($req); | ||
|
|
||
| $domain = Ravada::Front::Domain->open($domain->id); | ||
| my $status = $domain->client_status(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Creates a refresh machine request to check in background the status of the client connection
closes #2293