R-a-dio / Hanyuu-sama

R/a/dio AFK Streamer and IRC Bot
42 stars 11 forks source link

Hanyuu thinks she is streaming when she isnt #48

Closed ameliaikeda closed 11 years ago

ameliaikeda commented 11 years ago

self explanatory. adding this to the stable milestone. Comments about status and errors found below, please~

Bevinsky commented 11 years ago

I do believe we have figure out why this happens. The bug occurs when a DJ disconnects, and then reconnects almost immediately after; Hanyuu detects the drop of the stream, thinks the stream is down and connects after the DJ already reconnects. So, the DJ is streaming to the real mountpoint, and Hanyuu is stuck on the proxy. Since Hanyuu sees a mountpoint on the Icecast status page, she thinks she's streaming, so she just keeps on going.

Hanyuu also kills the listener, so she starts feeding her own metadata into the system instead of what is actually being played.

One way of fixing this is to stop Hanyuu from taking the stream immediately after it drops, though there is still a possible race condition there. Another, better solution is to make Hanyuu aware of the proxy status instead of the Icecast status. Then she would be able to more directly see who exactly is streaming, as well.

Perhaps the proxy can call a method in Hanyuu's main manager to tell her if someone is streaming or not, and even give a DJ ID as well.

Wessie commented 11 years ago

Instead of making Hanyuu aware of the proxy we can use a metadata comparison to check for this race condition.

If the metadata Hanyuu is streaming, and the metadata that is on the mount is not the same it can disconnect itself gracefully. We have to make sure the delay between metadata send and metadata show isn't caught in this case though.

Bevinsky commented 11 years ago

I've actually been thinking, why doesn't Hanyuu make sure that someone is connected or not RIGHT before she connects, or at least has a slight delay before actually connecting after which she checks if someone picked up the stream again?

I think we should try to avoid the situation where she even starts her streamer completely. It messes up meta scraping. Or well, if we separate hanyuu and the listener, that isn't really an issue, but the listener should be really good at making sure Hanyuu doesn't connect at all, in my opinion.

Wessie commented 11 years ago

Closed because we can't reproduce it anymore. This most likely got fixed in one of the various patches to the stream manager.

Bevinsky commented 11 years ago

This got fixed because hanyuu doesn't connect if she isn't set as DJ. The bug will most likely still be there if she is given a chance.