summaryrefslogtreecommitdiffstats
path: root/tests/basic
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2014-01-28 20:38:39 +0000
committerJeff Darcy <jdarcy@redhat.com>2014-01-29 12:53:52 +0000
commite1bfa08e63d3be4d76b0a72f11cd9129d75b04dd (patch)
tree414905da8f4e8330f075b58589398a864c546601 /tests/basic
parentb66f359fda0b43563e43e1a299542f088337846a (diff)
etcd-sim: fix stdio-buffering problem
Leader election was not working because processes were continuing to read their own cached copies of the data file contents, not seeing each others' changes. Fflush is not sufficient to ensure that data propagates from one process to another. Even ensuring that it gets to disk requires an fsync as well (which we weren't doing). The only viable solution is to *reopen* the data file with an empty buffer. This also makes it easier to ensure correct locking across the whole file, instead of just from the previous seek position to EOF. Change-Id: I165d55afd5804dc3f579ea7e55c56da5066ae6c1 Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'tests/basic')
0 files changed, 0 insertions, 0 deletions