• Martin Blix Grydeland's avatar
    Resolve race on waitinglist rushing between OC_F_BUSY and boc->state · 4130055c
    Martin Blix Grydeland authored
    When an object is ready for delivery, HSH_Unbusy was called before calling
    ObjSetState([BOS_STREAM|BOS_FINISHED]). The HSH_Unbusy() call does the
    waitinglist rushing, but HSH_Lookup() wanted to look at the boc->state and
    if BOS_STREAM had been reached. This could cause requests woken to find
    that the stream state still hadn't been reached (ObjSetState still hadn't
    executed), and go back on the waitinglist.
    
    To fix this, this patch reverts commit
    0375791c, and goes back to considering
    OC_F_BUSY as the gate keeper for HSH_Lookup. This eliminates the race,
    because HSH_Unbusy and HSH_Lookup then uses the same mutex.
    
    That change opens up the possiblity that req code after HSH_Lookup() sees
    an object that has not yet reached BOS_STREAM. In order to not have to add
    new ObjWaitState() calls (with the additional locking cost that would
    bring) to wait for BOS_STREAM, the order of events is changed throughout,
    and calls ObjSetState([BOS_STREAM|BOS_FINISHED]) before HSH_Unbusy(). That
    way, an object returned from HSH_Lookup() is guaranteed to be at least
    BOS_STREAM.
    4130055c
Name
Last commit
Last update
..
compat Loading commit data...
tbl Loading commit data...
vapi Loading commit data...
Makefile.am Loading commit data...
binary_heap.h Loading commit data...
generate.py Loading commit data...
libvcc.h Loading commit data...
miniobj.h Loading commit data...
vas.h Loading commit data...
vav.h Loading commit data...
vbm.h Loading commit data...
vbm_test.c Loading commit data...
vcc_interface.h Loading commit data...
vcli.h Loading commit data...
vcli_serve.h Loading commit data...
vcs.h Loading commit data...
vct.h Loading commit data...
vcurses.h Loading commit data...
vdef.h Loading commit data...
vend.h Loading commit data...
verrno.h Loading commit data...
vev.h Loading commit data...
vfil.h Loading commit data...
vfl.h Loading commit data...
vin.h Loading commit data...
vjsn.h Loading commit data...
vlu.h Loading commit data...
vmb.h Loading commit data...
vnum.h Loading commit data...
vpf.h Loading commit data...
vqueue.h Loading commit data...
vre.h Loading commit data...
vrnd.h Loading commit data...
vrt.h Loading commit data...
vsa.h Loading commit data...
vsb.h Loading commit data...
vsc_priv.h Loading commit data...
vsha256.h Loading commit data...
vsl_priv.h Loading commit data...
vsm_priv.h Loading commit data...
vss.h Loading commit data...
vsub.h Loading commit data...
vtcp.h Loading commit data...
vtim.h Loading commit data...
vtree.h Loading commit data...
vus.h Loading commit data...
vut.h Loading commit data...
vut_options.h Loading commit data...