File tree Expand file tree Collapse file tree 3 files changed +11
-23
lines changed Expand file tree Collapse file tree 3 files changed +11
-23
lines changed Original file line number Diff line number Diff line change @@ -2745,12 +2745,9 @@ Notes & Caveats
2745
2745
need to serialize these operations in a single thread in a single
2746
2746
process. You will corrupt your data otherwise. See the issue
2747
2747
(:`2397 `) for more information.
2748
- - If serializing all write operations via a single thread in a single
2749
- process is not an option, another alternative is to use an external
2750
- distributed lock manager to ensure there is only a single writer at a
2751
- time and all readers close the file during writes and re-open it after any
2752
- writes. In this case you should use ``store.flush(fsync=True) `` prior to
2753
- releasing any write locks. See the issue (:`5364 `) for more information.
2748
+ - If you use locks to manage write access between multiple processes, you
2749
+ may want to use :py:func: `~os.fsync ` before releasing write locks. For
2750
+ convenience you can use ``store.flush(fsync=True) `` to do this for you.
2754
2751
- ``PyTables `` only supports fixed-width string columns in
2755
2752
``tables ``. The sizes of a string based indexing column
2756
2753
(e.g. *columns * or *minor_axis *) are determined as the maximum size
Original file line number Diff line number Diff line change @@ -530,21 +530,17 @@ def flush(self, fsync=False):
530
530
"""
531
531
Force all buffered modifications to be written to disk.
532
532
533
- By default this method requests PyTables to flush, and PyTables in turn
534
- requests the HDF5 library to flush any changes to the operating system.
535
- There is no guarantee the operating system will actually commit writes
536
- to disk.
537
-
538
- To request the operating system to write the file to disk, pass
539
- ``fsync=True``. The method will then block until the operating system
540
- reports completion, although be aware there might be other caching
541
- layers (eg disk controllers, disks themselves etc) which further delay
542
- durability.
543
-
544
533
Parameters
545
534
----------
546
- fsync : boolean, invoke fsync for the file handle, default False
535
+ fsync : bool (default False)
536
+ call ``os.fsync()`` on the file handle to force writing to disk.
547
537
538
+ Notes
539
+ -----
540
+ Without ``fsync=True``, flushing may not guarantee that the OS writes
541
+ to disk. With fsync, the operation will block until the OS claims the
542
+ file has been written; however, other caching layers may still
543
+ interfere.
548
544
"""
549
545
if self ._handle is not None :
550
546
self ._handle .flush ()
Original file line number Diff line number Diff line change @@ -465,11 +465,6 @@ def test_flush(self):
465
465
with ensure_clean (self .path ) as store :
466
466
store ['a' ] = tm .makeTimeSeries ()
467
467
store .flush ()
468
-
469
- def test_flush_fsync (self ):
470
-
471
- with ensure_clean (self .path ) as store :
472
- store ['a' ] = tm .makeTimeSeries ()
473
468
store .flush (fsync = True )
474
469
475
470
def test_get (self ):
You can’t perform that action at this time.
0 commit comments