OpenHFT / Chronicle-Queue

Micro second messaging that stores everything to disk
http://chronicle.software/products/chronicle-queue/
Apache License 2.0
3.31k stars 532 forks source link

Throw an exception when disk is about to run out of space #547

Closed anirudh-striim closed 6 years ago

anirudh-striim commented 6 years ago

Currently, chronicles throw a warning message, which is of not much help when being used in tech stack along with some other softwares. It would be helpful if it was an exception.

RobAustin commented 6 years ago

This is not a bug as it only warns when the disk space is running low. Not all of our users will want the code to throw an exception here. I suggest you copy the disk check code and make the change locally if you want different behaviour.

anirudh-striim commented 6 years ago

I can change the code but the only problem would be when I upgrade the version of Chronicles every time, this needs to be handled manually. It would be helpful if there was an option to specify if to throw exceptions or not.

dpisklov commented 6 years ago

@anirudh-striim it seems you are trying to use the problem with the tool that is not designed for that while there're plenty of tools specifically doing what you want. What you really need is a proper disk space monitor - and there're dozens out there - quick googling finds modules for Nagios and no doubt similar exist for any other monitoring system. And if you don't have a monitoring system - you have bigger problems, running without any monitoring is like driving blindfolded on a motorway while wearing earplugs. The warnings we provide are really designed for things like Splunk or any log scrapper that generates monitoring alerts from log files, and intended only as a supplement for the monitoring solution but not replacement. Finally, throwing exception deep in guts of the queue is much harder to code around, comparing to the monitoring system executing shutdown script if the disk space threshold reaches, so implementing this properly in your environment is a win-win. HTH D