JioTV-Go / jiotv_go

Unlock the magic of JioTV across all your devices, without the need for the JioTV App. Crafted with love in Golang for a delightful blend of speed and efficiency! 🌟✨
https://jiotv_go.rabil.me/
Other
377 stars 98 forks source link

Bug: `fatal error: concurrent map iteration and map write` in net/http #31

Closed krz123 closed 1 year ago

krz123 commented 1 year ago

I am using this command in my phone

JIOTV_CREDENTIALS_PATH=credentials.json JIOTV_DNS=1.1.1.1 ./jiotv_go-v0.5.8-linux-arm64 "192.168.4.101:8080"

After run command starts working and also i am using in TV Remotely.but after some time stops working automatically. I have to run the command again ./jiotv_go-v0.5.8-linux-arm64 "192.168.4.101:8080"

Thank you.

rabilrbl commented 1 year ago

Don't provide JIOTV_CREDENTIALS_PATH and JIOTV_DNS as you're using default values.

Run it like ./jiotv_go-v0.5.8-linux-arm64 ":8080"

After executing like this, if you are facing problem, send logs from terminal with appropriate screenshots

krz123 commented 1 year ago

Screenshot_20230907-201934

rabilrbl commented 1 year ago

@krz123

Scroll up and send full ss

rabilrbl commented 1 year ago

@krz123 If possible, you can continue to discuss at telegram support group https://telegram.me/jiotv_go_chat

rabilrbl commented 1 year ago

As per @krz123 Sent SS on telegram, the issue is related to fatal error: concurrent map iteration and map write as in screenshot below

SS1 SS2
photo_2023-09-07_20-52-31 photo_2023-09-07_20-52-31 (2)
rabilrbl commented 1 year ago

The issue is related to GIN, check open issue https://github.com/gin-gonic/gin/issues/3387

The issue should be solved when migrating to go fiber #30

rabilrbl commented 1 year ago

As it turns out, I frankly have no idea, what's causing concurrent map iteration. Mostly It is related to updating and deleting header in net/http request in /render.m3u8 route. I can push a fix using mutex. But for the moment I am planning to change to fasthttp as we have gofiber migration upcoming.

dheerajv4855 commented 1 year ago

gin, gofiber is just routing framework so we cannot say this issue wont come with gofiber migration for now i have code fix related to mutex and that is working fine

rabilrbl commented 1 year ago

@dheerajv4855 As mentioned in your PR.

gofiber is built on top of fasthttp, similar to gin built on top net/http, hence fasthttp is an alternative to net/http, So i migrated from net/http to fasthttp. fasthttp performs well on concurrency. But net/http is better with standards, which is not relevant in our small application.

rabilrbl commented 1 year ago

Fixed in #30