|
1 | 1 | # Changelogs |
2 | 2 |
|
| 3 | +## [v2.1.0] - 2026-10-17 |
| 4 | + |
| 5 | +Matches C++ [slick-stream-buffer v2.1.0](https://github.com/SlickQuant/slick-stream-buffer/blob/main/CHANGELOG.md): |
| 6 | +no buffer removes its shared-memory segment on its own any more, and `remove_shm()` is how the |
| 7 | +coordinating process does. The shared memory format is unchanged (`SSB1`), so 2.0 and 2.1 |
| 8 | +processes in either language can share a segment. |
| 9 | + |
| 10 | +### Segment lifetime (behavior change) |
| 11 | +- On POSIX, a segment is no longer unlinked when the process that created it exits. |
| 12 | + `SharedMemory(create=True)` registered it with `multiprocessing`'s resource tracker, which |
| 13 | + unlinks what is registered when the process exits, so a producer that exited first stranded |
| 14 | + every consumer still attached on an orphaned mapping, while its restart silently created a |
| 15 | + fresh segment under the same name that those consumers never saw. C++ v2.1.0 stopped its |
| 16 | + destructor doing the same. A name now lives until `unlink()`, `remove_shm()` or |
| 17 | + `remove(name)`, and a restarted process reattaches to the existing segment and keeps its |
| 18 | + contents. Windows is unaffected: a section dies with its last handle. |
| 19 | +- The buffer sends the resource tracker nothing at all: `track=False` on Python 3.13+, and on |
| 20 | + older POSIX Pythons a `SharedMemory` subclass that maps the segment without registering it. |
| 21 | + The 2.0.0 bookkeeping of which names this process had registered is gone, and `remove()` no |
| 22 | + longer contacts the tracker. |
| 23 | +- Migration: code that relied on the cleanup at exit now leaves segments in `/dev/shm`, and its |
| 24 | + next run attaches to them - `own_buffer` is `False`, reading resumes from the old cursors, and |
| 25 | + a creator with a different geometry raises `RuntimeError` ("geometry mismatch"). Call |
| 26 | + `remove(name)` at startup for a clean start, or `unlink()` / `remove_shm()` at shutdown once |
| 27 | + no peer will attach again. |
| 28 | + |
| 29 | +### Added |
| 30 | +- `remove_shm() -> bool`, matching C++: unlinks this buffer's segment name so the next creator |
| 31 | + starts fresh, leaving open mappings - this buffer's own included - valid. It unlinks by name |
| 32 | + on every call, where `unlink()` runs once, and leaves `unlink()` nothing to do afterwards, so a |
| 33 | + later `unlink()` cannot delete a replacement created under the name. Returns `False` for a |
| 34 | + local-memory buffer or when the name is already gone, and always `True` for a shared buffer on |
| 35 | + Windows. C++ v2.1.0's |
| 36 | + other addition, `shm_name()`, is the existing `get_shm_name()` (`None` rather than `""` for a |
| 37 | + local-memory buffer). |
| 38 | + |
| 39 | +### Fixed |
| 40 | +- Before Python 3.13 on POSIX, a process that only attached to a segment unlinked it when it |
| 41 | + exited, because attaching registered the name with that process's resource tracker too. |
| 42 | + 2.0.0 avoided this only on 3.13+, through `track=False`. |
| 43 | + |
| 44 | +### Tests |
| 45 | +- Segment lifetime: `unlink()` repeated, `remove_shm()` on local and shared buffers, `unlink()` |
| 46 | + after `remove_shm()` sparing a replacement segment, a |
| 47 | + creator's and an attacher's exit in a fresh interpreter, no resource-tracker traffic at all, |
| 48 | + a child forked while another thread is constructing a buffer, and spawned children attaching |
| 49 | + at once. A test that `remove()` leaves the tracker alone for this process's own segment |
| 50 | + replaces the 2.0.0 one that it retracted the registration. |
| 51 | +- The interop tests build against C++ slick-stream-buffer `v2.1.0` (was `v2.0.0`). The two in |
| 52 | + which C++ creates the segment remove it before starting and after the producer exits, since |
| 53 | + C++ now leaves it in place; a rerun used to attach to the previous run's segment. |
| 54 | +- Tests that hand-build a raw segment open it through the library's opener, so that handle and |
| 55 | + the buffer no longer both claim the name in the resource tracker. |
| 56 | + |
| 57 | +Checked against C++ slick-stream-buffer v2.1.0 with the interop tests on Windows and on Linux, |
| 58 | +run three times on Linux so a segment left behind would fail a rerun, and on Linux under |
| 59 | +Python 3.12 (the subclass) and 3.14 (`track=False`). |
| 60 | + |
3 | 61 | ## [v2.0.0] - 2026-09-12 |
4 | 62 |
|
5 | 63 | Matches C++ [slick-stream-buffer v2.0.0](https://github.com/SlickQuant/slick-stream-buffer/blob/main/CHANGELOG.md). |
|
0 commit comments