monitoring-mixins / mixtool

mixtool is a helper for easily working with jsonnet mixins.
Apache License 2.0
139 stars 15 forks source link

Changes to sidecar to fix some issues #30

Open allenmqcymp opened 4 years ago

allenmqcymp commented 4 years ago

While working on reloading rule files, I noticed two errors.

  1. Open file does not open with the correct permissions if the file already exists
  2. Truncate file does not update the file pointer, leading to some weird control characters

The PR fixes both the issues

roidelapluie commented 4 years ago

I dont think the way we deal with file is safe, we should create a new one then rename it to the old one. This way this is atomic.

squat commented 4 years ago

Great suggestion, @roidelapluie. The current implementation in master is simply broken whenever you write the second time, even ignoring race conditions, so what @allenmqcymp is proposing is a net-improvement IMO. In any case, @allenmqcymp, if you are up for it, implementing the solution @roidelapluie suggests would be even better :)

allenmqcymp commented 4 years ago

@roidelapluie @squat latest commit does just that. PTAL :)

metalmatze commented 3 years ago

Looks good, only needs a rebase to get rid of the conflict in go.sum :slightly_smiling_face: