ChanServ changed the topic of #cinch to: The IRC Framework | http://groups.google.com/group/cinch-ruby/ | Latest version: Cinch 2.0.4 – Change log at http://bit.ly/14Q4s6Z – Migration guide at http://bit.ly/GO4qkW | This channel is being publicly logged at http://irclog.whitequark.org/cinch/
jonahR has quit [Quit: jonahR]
jonahR has joined #cinch
postmodern has quit [Ping timeout: 240 seconds]
postmodern has joined #cinch
literal has quit [Ping timeout: 248 seconds]
literal has joined #cinch
jonahR has quit [*.net *.split]
mlue has quit [*.net *.split]
ayonix has quit [*.net *.split]
aytch has quit [*.net *.split]
catepillar has quit [*.net *.split]
sindork has quit [*.net *.split]
framling has quit [*.net *.split]
jonahR has joined #cinch
aytch has joined #cinch
catepillar has joined #cinch
mlue has joined #cinch
ayonix has joined #cinch
sindork has joined #cinch
framling has joined #cinch
jonahR has quit [*.net *.split]
mlue has quit [*.net *.split]
ayonix has quit [*.net *.split]
catepillar has quit [*.net *.split]
aytch has quit [*.net *.split]
jonahR has joined #cinch
mlue has joined #cinch
ayonix has joined #cinch
catepillar has joined #cinch
aytch has joined #cinch
postmodern has quit [Ping timeout: 264 seconds]
Spaceghost has quit [Ping timeout: 276 seconds]
postmodern has joined #cinch
postmodern has quit [Ping timeout: 276 seconds]
postmodern has joined #cinch
_whitelogger_ has joined #cinch
waxjar has quit [Ping timeout: 260 seconds]
waxjar has joined #cinch
aytch is now known as AmbienWa1rus
AmbienWa1rus is now known as aytch
aytch is now known as bunnable
bunnable is now known as AmbienWalrus
AmbienWalrus is now known as aytch
aytch is now known as AmbienCarpenter
AmbienCarpenter is now known as DefinitelyShayda
DefinitelyShayda is now known as whassasecretpass
whassasecretpass is now known as aytch
space has joined #cinch
space is now known as Guest55430
Guest55430 is now known as Spaceghost
postmodern has joined #cinch
Spaceghost is now known as Guest17962
Guest17962 is now known as Spaceghost
Spaceghost has quit [Changing host]
Spaceghost has joined #cinch
jonahR has quit [Quit: jonahR]
space_ has joined #cinch
Spaceghost has quit [Ping timeout: 240 seconds]
sindork has quit [Ping timeout: 264 seconds]
sindork has joined #cinch
postmodern has quit [Quit: Leaving]
v0n has joined #cinch
<nickrw> a bot of mine just went crazy
<nickrw> Its connection timed out from the network it was connected to. It auto-reconnected and suddenly started firing Timers
<dominikh> started firing how?
<nickrw> [2013/06/19 14:38:18.363] !! [New thread] For #<Cinch::Handler @event=:complete_startup pattern=#<Cinch::Pattern:0x000
<nickrw> 000015b5008 @prefix=nil, @pattern=//, @suffix=nil>>: #<Thread:0x0000000186c3c8> -- 3 in total.
<nickrw> :complete_startup is a misleading name
<nickrw> it's an event I schedule a Timer for 300 seconds after user input
<nickrw> which is an event that *hadn't* been raised when the bot disconnected
<dominikh> I'll look into it.
<nickrw> it fired a few different Timers that I didn't expect, each one 3 times
<nickrw> I think it made 3 partially-successful reconnect attempts
<nickrw> hm, no, one failed reconnect attempt (SSL handshake error) and then success on the next try
Spami has joined #cinch
Spami has joined #cinch
Spami has quit [Changing host]
<dominikh> nickrw: can I have the log starting from shortly before the disconnect/timeout?
<dominikh> and up to the timers firing?
<nickrw> yeah sure
<nickrw> will in a few hours
<dominikh> heh.
<nickrw> (debugging IRC game bots, even though they live on my work IRC server, not part of my job description :P )
<dominikh> but IRCing is? :P
jonahR has joined #cinch
<nickrw> how else would I converse with colleagues?
<nickrw> It's not like we're all in the same room ¬_¬
<nickrw> oh wait
<dominikh> hehe
<dominikh> I'm not your colleague :P
<nickrw> ah boo, the interesting events have moved out of my tmux buffer already
<dominikh> that's.. very unfortunate
<dominikh> can't really debug it without that
<nickrw> I can try to reproduce later
<nickrw> but I do notice that whenever I start a new timer, I get these in the log as well:
<nickrw> [on handler] Registering handler with pattern `#<Cinch::Pattern:0x00000002696b10 @prefix=
<nickrw> nil, @pattern=//, @suffix=nil>`, reacting on `connect`
<nickrw> (also disconnect)
<dominikh> (that's correct). but wait a second, do you dynamically create timers?
<dominikh> I probably will want to see the code of the actual plugins with misfiring timers. there's too many factors playing into this
jonahR has quit [Quit: jonahR]
<nickrw> so user runs !start command to kick off registration, timer is created to raise an event to finish signup 5 minutes later
<dominikh> (I won't comment on the fact your code is racy for now, it probably doesn't matter here)
<dominikh> but yeah, I see the issue :)
<dominikh> add a :start_automatically => false to your Timer() call. there's, uhm. a really silly bug/flaw in the API
<dominikh> timers get stopped on a disconnect and started on a connect. issue here is, they forget how often they fired.
<dominikh> so if anyone used !start, after a reconnect it will run again after the delay
<nickrw> ah cool
<nickrw> racy as in race condition?
<dominikh> (fwiw, there's also a memory leak involving timers, but I'm hoping you don't create enough timers to run into it any time soon)
<nickrw> I've started to address that recently
<dominikh> yup, racy as in race condition
<nickrw> I've yet to encounter an actual race condition bug, but I did use #synchronize for something recently
<nickrw> but only because the bot itself was raising an event that two plugins were responding to, and were going to modify the same data
<dominikh> actually I'm not sure if ||= is atomic, but let's assume it's not (I don't think it is.): if two people use !start at the same time and shared[:timer] isn't set yet, you might call Hash.new twice, possibly losing one of the timers you add
<nickrw> oh interesting
<dominikh> also, what I am wondering about your hook_async right now: what happens if you run it multiple times with the same method? you seem to be only storing one timer
<nickrw> yeah, aware of that - limitation of the design but I don't yet have the same event firing multiple times in a row
<nickrw> I thought about making it support multiple events of the same method at the time, but I couldn't think of a good way to clean up old ones
<nickrw> some sort of GC to look through it for dead threads
<dominikh> brb
<dominikh> just store the timers in an array and #delete them when you're done. same way you're doing now, but with an Array#delete with the Timer object instead
<nickrw> oh good point
<nickrw> not sure how to have hook_cancel handle it though, apart from just cancelling them all
<dominikh> is that a user command? then no way other than introducing some sort of ID system
<nickrw> not directly, no
<nickrw> other plugins call hook_cancel upon some user interaction in order to interrupt normal state change
<nickrw> but at present, there is only one of each event at any one time
Spami has quit [Quit: This computer has gone to sleep]
Spami has joined #cinch
Spami has quit [Ping timeout: 264 seconds]
jonahR has joined #cinch
rikai has quit [Read error: Connection reset by peer]
rikai has joined #cinch
space_ is now known as Spaceghost
Spaceghost has quit [Changing host]
Spaceghost has joined #cinch
postmodern has joined #cinch
Spaceghost has quit [Read error: Connection reset by peer]
Spaceghost has joined #cinch
Spaceghost is now known as Guest2023
space_ has joined #cinch
jonahR has quit [Quit: jonahR]
Guest2023 has quit [Ping timeout: 248 seconds]
space_ is now known as Spaceghost
Spaceghost has quit [Changing host]
Spaceghost has joined #cinch
v0n has quit [Ping timeout: 264 seconds]
jonahR has joined #cinch
Netfeed has quit [Ping timeout: 260 seconds]
Netfeed has joined #cinch
waxjar has quit [Ping timeout: 264 seconds]