From 7a3e0f8275d333549438cd7d4cadee868fe3d6e2 Mon Sep 17 00:00:00 2001 From: Kyle Havlovitz Date: Mon, 7 Nov 2016 15:24:31 -0500 Subject: [PATCH] Add a note about not calling sync for persistCheckState --- command/agent/agent.go | 1 + 1 file changed, 1 insertion(+) diff --git a/command/agent/agent.go b/command/agent/agent.go index bb294b4469..10e3a4e0d7 100644 --- a/command/agent/agent.go +++ b/command/agent/agent.go @@ -1100,6 +1100,7 @@ func (a *Agent) persistCheckState(check *CheckTTL, status, output string) error // Create temp file in same dir, to make more likely atomic tempFile := file + ".tmp" + // persistCheckState is called frequently, so don't use writeFileAtomic to avoid calling fsync here if err := ioutil.WriteFile(tempFile, buf, 0600); err != nil { return fmt.Errorf("failed writing temp file %q: %s", tempFile, err) }