Skip to content

Commit c5c29fd

Browse files
daidavid1Databean
authored andcommitted
Check for reboot completion and rebalance threads
Rebalance needs to occur after crosvm restarts and after "adb reboot" occurs in the guest. Check for another BootCompleted event in the monitoring thread and rebalance the threads. Bug: b/408290580 Test: m && adb reboot and saw that the threads migrated
1 parent ee1db7c commit c5c29fd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

base/cvd/cuttlefish/host/commands/run_cvd/boot_state_machine.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,15 @@ class CvdBootStateMachine : public SetupFeature, public KernelLogPipeConsumer {
511511
if (!read_result.ok()) {
512512
return;
513513
}
514+
if ((*read_result)->event == monitor::Event::BootCompleted) {
515+
LOG(INFO) << "Virtual device rebooted successfully";
516+
if (!instance_.vcpu_config_path().empty()) {
517+
auto res = WattsonRebalanceThreads(instance_.id());
518+
if (!res.ok()) {
519+
LOG(ERROR) << res.error().FormatForEnv();
520+
}
521+
}
522+
}
514523
}
515524
}
516525
}

0 commit comments

Comments
 (0)