ackwell / ninjabot

Ninjabot is not 'Just Another Bot'
10 stars 8 forks source link

race condition crash when sending the queue #92

Closed auscompgeek closed 10 years ago

auscompgeek commented 10 years ago

not entirely sure what's going on here, but it definitely looks like a race condition.

bot stdout:

PING :cameron.freenode.net
SENT: PONG cameron.freenode.net

Writing storage to disk
:gnustomp!gnustomp@unaffiliated/gnustomp PRIVMSG ##hypnotoad :https://forum.groklearning.com/t/py-malware-dont-test-it/7248
Starting new HTTPS connection (1): forum.groklearning.com
Starting new HTTPS connection (1): groklearning.com
Starting new HTTPS connection (1): forum.groklearning.com
Starting new HTTPS connection (1): groklearning.com
:gnustomp!gnustomp@unaffiliated/gnustomp PRIVMSG ##hypnotoad :.-.
:gnustomp!gnustomp@unaffiliated/gnustomp PRIVMSG ##hypnotoad :i disapprove
:PaperBag!~bucket@unaffiliated/forkbomb/bot/paperbag PRIVMSG ##hypnotoad :\u0ca0_\u0ca0
SENT: PRIVMSG ##hypnotoad :Title: Grok Learning

error: uncaptured python exception, closing channel <__main__.Ninjabot connected chat.freenode.net:6667 at 0x7fb48a518780> (<class 'IndexError'>:deque index out of range [/usr/lib/python3.4/asyncore.py|write|91] [/usr/lib/python3.4/asyncore.py|handle_write_event|461] [/usr/lib/python3.4/asynchat.py|handle_write|178] [/usr/lib/python3.4/asynchat.py|initiate_send|250])
Writing storage to disk

what we saw:

19:15:00  +gnustomp | https://forum.groklearning.com/t/py-malware-dont-test-it/7248
19:15:01  +gnustomp | .-.
19:15:03  +gnustomp | i disapprove
19:15:03   PaperBag | ಠ_ಠ
19:15:06    NCSSBot | Title: Grok Learning
19:15:06    NCSSBot | Title: Grok Learning
19:15:19  +gnustomp | i should just reply with while True: os.fork()
19:15:19        <-- | NCSSBot (~ninjabot@[redacted]) has quit (Remote host closed the connection)
auscompgeek commented 10 years ago

btw, that second set of HTTPS connections is because linkinfo currently GETs redirects again, which is fixed by #93. just in case anyone is staring at it wondering what's going on there.

auscompgeek commented 10 years ago

Gonna close this for now. Seems to be fixed, but I may be wrong.

gnustomp commented 9 years ago

Uh, well it's definitely not fixed. Awaiting @auscompgeek's asyncio port.

auscompgeek commented 9 years ago

well, we can say this was about the race condition causing a crash. shrug

shall continue discussion in #96.