Commit 996dc6a8 authored by Kirill Smelkov's avatar Kirill Smelkov

X Fix race in test

_blkaccess was called after send to have_read, thus a user could be
woken up before the block was actually marked as accessed and so
there is a window while _pinnedAt will return wrong data due to having
stale accessed set.

The bug was showing itself as assert happening from time to time
seldomly on e.g. `assert w.pinned = pin_prev` in watch.
parent 56aad370
...@@ -564,8 +564,8 @@ class tFile: ...@@ -564,8 +564,8 @@ class tFile:
have_read = chan(1) have_read = chan(1)
def _(): def _():
b = read_nogil(blkview[0:1]) b = read_nogil(blkview[0:1])
have_read.send(b)
t._blkaccess(blk) t._blkaccess(blk)
have_read.send(b)
go(_) go(_)
_, _rx = select( _, _rx = select(
ctx.done().recv, # 0 ctx.done().recv, # 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment