(self)
| 764 | |
| 765 | impl<F: Fn() + Send + Sync + 'static> ModuleLauncher<F> { |
| 766 | async fn launch_module(self) -> anyhow::Result<(Program, LaunchedModule)> { |
| 767 | let db_identity = self.database.database_identity; |
| 768 | info!( |
| 769 | "launching module db={} replica={} program={} host_type={}", |
| 770 | db_identity, |
| 771 | self.replica_id, |
| 772 | self.program.hash, |
| 773 | HostType::from(self.program.kind) |
| 774 | ); |
| 775 | |
| 776 | let replica_ctx = make_replica_ctx( |
| 777 | self.module_logs, |
| 778 | self.database, |
| 779 | self.replica_id, |
| 780 | self.relational_db, |
| 781 | self.bsatn_rlb_pool, |
| 782 | ) |
| 783 | .await |
| 784 | .map(Arc::new)?; |
| 785 | let (scheduler, scheduler_starter) = Scheduler::open(replica_ctx.relational_db().clone()); |
| 786 | let (program, module_host) = make_module_host( |
| 787 | self.runtimes.clone(), |
| 788 | replica_ctx.clone(), |
| 789 | scheduler.clone(), |
| 790 | self.program, |
| 791 | self.energy_monitor, |
| 792 | self.on_panic, |
| 793 | self.core, |
| 794 | ) |
| 795 | .await?; |
| 796 | |
| 797 | trace!("launched database {} with program {}", db_identity, program.hash); |
| 798 | |
| 799 | Ok(( |
| 800 | program, |
| 801 | LaunchedModule { |
| 802 | replica_ctx, |
| 803 | module_host, |
| 804 | scheduler, |
| 805 | scheduler_starter, |
| 806 | }, |
| 807 | )) |
| 808 | } |
| 809 | } |
| 810 | |
| 811 | fn repair_stale_view_backing_tables_on_launch(launched: &LaunchedModule) -> anyhow::Result<()> { |
no test coverage detected