deepch / RTSPtoWeb

RTSP Stream to WebBrowser
MIT License
1.27k stars 302 forks source link

Multiple concurrency-related issues/crashes #294

Open Robertof opened 1 year ago

Robertof commented 1 year ago

Thank you for this project, it has been incredibly helpful!

I have found multiple concurrency issues which can be easily reproduced and usually lead to a crash. It's easy to figure out the offending codepaths by running RTSPToWeb with the Go race detector (go run -race .). I have spotted at least three issues and I intend to submit patches for two of them:

This can reliably reproduce the first two concurrency issues (just substitute <streamid> and <channel> with appropriate values in your config):

for i in {1..10}; do ( curl -s http://localhost:8083/stream{s,/<stream>/channel/<channel>/codec}; ) & done