HelixNetwork / pendulum

Pendulum is a distributed messaging protocol that enables globally available tamper proof timestamps :hourglass_flowing_sand:
https://dev.hlx.ai
Other
10 stars 6 forks source link

saveLogs method refactor for mtail #124

Closed dnck closed 5 years ago

dnck commented 5 years ago

Currently, the saveLogs method in utils/HelixIOUtils.java saves the log file under a name with a datetime stamp with precision down to the seconds.

However, in a docker set-up, I am sharing a volume between >1 containers so that the nodes can write their log file to a shared directory on the host.

The problem with this is that if two nodes write the same name for the log file, then there might be a conflict and some type of race-condition might occur.

To fix this, we could use insert a UUID in the log file names.

Additionally, the saveLogs method can be simplified for clarity, using, for example, the String.join method.

If approved, I can submit a simple pull request with a refactor of the saveLogs method that fixes these two issues.