[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: stream closed (IOError

Yukihiro Matsumoto

10/5/2008 3:47:00 PM

Hi,

In message "Re: stream closed (IOError)"
on Sun, 5 Oct 2008 23:54:36 +0900, "Eric Will" <rakaur@malkier.net> writes:

|Line 231 is the @socket.close line. Nothing gets done to the socket
|after this, or if it is, it's not getting to it because it crashes on
|@socket.close. Nothing should even be touching the entire object after
|this, because it sets a flag saying "I'm dead, please GC me."

I don't think we can trust line numbers here, maybe due to bugs. The
back trace does not make sense at all.

|/Users/rakaur/Sources/wc/ruby/synapse/trunk/lib/xmppd/xmpp/stream.rb:230:in
|`ioloop': stream closed (IOError)
| from /Users/rakaur/Sources/wc/ruby/synapse/trunk/lib/xmppd.rb:197:in `loop'
| from /Users/rakaur/Sources/wc/ruby/synapse/trunk/lib/xmppd.rb:197:in `ioloop'
| from ./bin/xmppd:20

stream.rb:230 is not within ioloop; xmppd:20 does not call ioloop.
The fact rescue does not catch the exception also suggest the wrong
line numbers. How about stopping using timer library, as a start?

matz.

5 Answers

Eric Will

10/5/2008 4:01:00 PM

0

On Sun, Oct 5, 2008 at 11:46 AM, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
> I don't think we can trust line numbers here, maybe due to bugs. The
> back trace does not make sense at all.
> [...]
> stream.rb:230 is not within ioloop; xmppd:20 does not call ioloop.
> The fact rescue does not catch the exception also suggest the wrong
> line numbers. How about stopping using timer library, as a start?

Hey matz. Thanks for your help. Everything is within ioloop.
bin/xmppd:20 is `XMPPd.instance.ioloop`
When I don't use the timers, this doesn't happen. In fact, it doesn't
happen until I use that specific Timer to do connection timeouts in
lib/xmppd.rb.


> matz.

-- Eric Will

Iñaki Baz Castillo

10/5/2008 4:04:00 PM

0

El Domingo, 5 de Octubre de 2008, Eric Will escribi=F3:
> On Sun, Oct 5, 2008 at 11:46 AM, Yukihiro Matsumoto <matz@ruby-lang.org>=
=20
wrote:
> > I don't think we can trust line numbers here, maybe due to bugs. The
> > back trace does not make sense at all.
> > [...]
> > stream.rb:230 is not within ioloop; xmppd:20 does not call ioloop.
> > The fact rescue does not catch the exception also suggest the wrong
> > line numbers. How about stopping using timer library, as a start?
>
> Hey matz. Thanks for your help. Everything is within ioloop.
> bin/xmppd:20 is `XMPPd.instance.ioloop`
> When I don't use the timers, this doesn't happen. In fact, it doesn't
> happen until I use that specific Timer to do connection timeouts in
> lib/xmppd.rb.

Not sure if your problem could be related to this post:

http://blog.headius.com/2008/02/rubys-threadraise-threadkill-time...




=2D-=20
I=F1aki Baz Castillo

Eric Will

10/5/2008 4:10:00 PM

0

On Sun, Oct 5, 2008 at 12:03 PM, I=F1aki Baz Castillo <ibc@aliax.net> wrote=
:
> Not sure if your problem could be related to this post:
>
> http://blog.headius.com/2008/02/rubys-threadraise-threadkill-tim...
ml

Not sure I grasp everything going on there. I don't use threads for
anything EXCEPT running my timers, which use Timeout. This could
potentially be the culprit, but I have no idea how that helps me.
Trying to rescue the IOError in my Timer library hasn't worked,
either.

matz, any input on this?

Thanks guys.

-- Eric Will

Eric Will

10/5/2008 4:43:00 PM

0

On Sun, Oct 5, 2008 at 12:33 PM, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
> Since I still can not reproduce the problem, I can not say clearly, but:
>
> * timer callback may touch the socket right after it's closed.
> * you've mixed fork and threads, which may not work properly.
> * you don't need timeout.rb. try attached simpler version.

Thanks. I should have thought of that to begin with. :)

It doesn't have to do with fork. In all my tests I run it with
--nofork (which skips forking). The only thing using threads was
timer.rb.

Googling found me some Japanese posts, but that didn't help. The rest
seemed to be fixed by checking socket#closed? first.

Thanks so much.

>
> matz.
>

-- Eric Will

Eric Will

10/5/2008 7:56:00 PM

0

On Sun, Oct 5, 2008 at 12:33 PM, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
> * you don't need timeout.rb. try attached simpler version.

While simpler version, this causes the same error...

> matz.

-- Eric Will