Writer can't acquire write lock
Describe the bug
we send video packet (tens to hundreds of KB)throught cyber with one writer and two readers. the frequency is about 400hz. writer can't acquire write lock.
Run information
- cyber version: 8.0.0
- run in docker
- ubuntu18.04
- hardware information
To Reproduce
sorry,it is random but always happen when writer and reader run for a long enough period(one day for example)
- log of call writer.Write in business code.
- cyber log of open shm
- cyber log of open shm
- repeat log for can't acquire write lock.
from log above,we located code here:
https://github.com/ApolloAuto/apollo/blob/r8.0.0/cyber/transport/shm/block.cc#L38
it seem that all block has read or write lock and never release. but we don't know why and how it happened. anybody can help?really appreciate.
Could you provide a demo that reproduces this issue? I can take some time to solve it.
hi,the snippet is in our biz code. but I already know how to reproduce it.
- create a writer write to channel with high frenquency.
- create a reader read from this channel.
- make writer and reader exit abnormal(for example in anthoer thread)
- make sure reader and writer always restart automatically.
- run for a while
then you will find some block's block num is -1 or 1 forever.
@daohu527