Horust icon indicating copy to clipboard operation
Horust copied to clipboard

Memory leak in healthcheck

Open gmarkey opened this issue 1 year ago • 1 comments

First of all, I want to thank you for writing an excellent init system for containers. Horust finds a fantastic balance of simplicity and functionality.

Version Information:

  • Version: 4d28be609c8bfa3f480c60288c9c0454839c13d2

Description:

There appears to be a memory leak caused by health checks as a copy of an object describing the service is created every check interval. Additionally, disabling the health check feature flag does not resolve the issue as the code is not completely removed. To workaround the issue I have manually patched out the checking code (I am not proficient with rust, so I am not confident in raising a PR for this).

gmarkey avatar Aug 28 '23 01:08 gmarkey

Thanks for letting me know! Would you be able to provide a reproducer? Also can you point out the code sections that you commented out to fix it? It would be super helpful! The feature flag is for enabling http feature flag, so the healthchecks as a feature are still running unfortunately.

FedericoPonzi avatar Aug 28 '23 21:08 FedericoPonzi

I've encountered the same issue, I need to comment out all the code below. fn run(self) { loop { let status = check_health(&self.service.healthiness); self.bus.send_event(Event::HealthCheck( self.service.name.clone(), status.clone(), )); match self .work_done_notifier .recv_timeout(Duration::from_millis(1000)) { Ok(()) | Err(RecvTimeoutError::Disconnected) => break, _ => (), }; } } `

vjeson avatar Apr 08 '24 01:04 vjeson