You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is kind of a strange bug, so I hope you understand it from my explanation.
It seems that when sending messages to a channel (i only tested it that way, might happen otherwise too) with the function privmsg, under some conditions lurklib will not send the messsage on time, but later.
Setup:
Every ten minutes I do the following out of a thread:
print('sending message')
bot.privmsg( channel, message)
print('finished sending')
I expect to see 'sending message', and 'finished sending' as ouput and the message should show up in the channel.
This sometimes work, but often not. The condition I observed is the following:
When there is no activity in the channel at all (no joins, no one talking, etc) and I let the program run for 30 minutes, I expect to see the above output 3 times, and the message in the channel 3 times.
However what I get is this:
sending message
sending message
sending message
and no message in the channel nor 'finished sending'. For some reason the call to privmsg blocks and is never finished.
When someone then writes something in the channel,or a nick is changed, etc, lurklib seems to 'wake up' and I see the message being sent to the channel 3 times and the program outputs finished sending 3 times.
The call to privmsg only finishes after there was some activity in the channel.
The text was updated successfully, but these errors were encountered:
This patch fixes the indefinite hold of the lock following a PING message
The _raw_recv and _mcon now respond to a PING message like all the other messages and will not block
This blocking would prevent the bot from performing "send" (and other) requests until activity unblocked the bot
This fix moves the PONG answer to the recv function where all the other messages processing takes place and returns the None event (no further processing required)
Fixesjamieleshaw#33
I had a similar issue as yours and found the culprit (and potential solution ;)
Basically, the bot checks every 10 milliseconds if there is new data to read and if there is, reads it.
The problem arises when the bot receives a PING request. Since there is new data to read, it tries to read it. But PING requests are handled differently.
The bot will only return to the main loop when it receives a message that is not a PING request. While it waits, the global lock is held and any call made from another thread to the bot will block.
My proposed solution is to handle the PING requests like all the other messages and return to the main loop immediately.
This is kind of a strange bug, so I hope you understand it from my explanation.
It seems that when sending messages to a channel (i only tested it that way, might happen otherwise too) with the function privmsg, under some conditions lurklib will not send the messsage on time, but later.
Setup:
Every ten minutes I do the following out of a thread:
print('sending message')
bot.privmsg( channel, message)
print('finished sending')
I expect to see 'sending message', and 'finished sending' as ouput and the message should show up in the channel.
This sometimes work, but often not. The condition I observed is the following:
When there is no activity in the channel at all (no joins, no one talking, etc) and I let the program run for 30 minutes, I expect to see the above output 3 times, and the message in the channel 3 times.
However what I get is this:
sending message
sending message
sending message
and no message in the channel nor 'finished sending'. For some reason the call to privmsg blocks and is never finished.
When someone then writes something in the channel,or a nick is changed, etc, lurklib seems to 'wake up' and I see the message being sent to the channel 3 times and the program outputs finished sending 3 times.
The call to privmsg only finishes after there was some activity in the channel.
The text was updated successfully, but these errors were encountered: