Signals to the worker threads that the migration is finished and joins them. If any thread encountered an error, this error is returned by this function.
(&mut self)
| 414 | /// Signals to the worker threads that the migration is finished and joins them. |
| 415 | /// If any thread encountered an error, this error is returned by this function. |
| 416 | pub(crate) fn cleanup(&mut self) -> Result<(), MigratableError> { |
| 417 | self.terminate_fd |
| 418 | .write(1) |
| 419 | .context("Failed to signal termination to worker threads.") |
| 420 | .map_err(MigratableError::MigrateReceive)?; |
| 421 | let accept_thread = self |
| 422 | .accept_thread |
| 423 | .take() |
| 424 | .context("Error taking accept thread.") |
| 425 | .map_err(MigratableError::MigrateReceive)?; |
| 426 | accept_thread |
| 427 | .join() |
| 428 | .map_err(|panic| { |
| 429 | MigratableError::MigrateReceive(anyhow!( |
| 430 | "Accept connections thread panicked: {panic:?}" |
| 431 | )) |
| 432 | }) |
| 433 | .flatten() |
| 434 | } |
| 435 | } |
| 436 | |
| 437 | impl Drop for ReceiveAdditionalConnections { |
no test coverage detected