Not killing proxied connection when browser leaves page

1 view
Skip to first unread message

SnacksOnAPlane

unread,
Aug 25, 2010, 11:37:32 PM8/25/10
to Orbited Discussion
I'm having trouble getting orbited to kill the connection it's
proxying.

I'm using it to run IRC through a web browser. When the user
disconnects, I would expect the IRC server to show the "remote host
closed the connection" message, but instead I get ping timeout. So
the code in proxy.py (in connectionLost) isn't killing the connection.

I traced the problem back to the connectionLost method in
cometsession.py TCPConnectionResource. It seems like the same
TCPConnectionResource instance gets reused so self.lostTriggered is
True every time after the first time. That means that connectionLost
in proxy.py only gets called once, at the beginning of the session.

It seems like there's a bug here somewhere where either the same
TCPConnectionResource shouldn't get used over and over or
self.lostTriggered should get flipped to False at some point.

Michael Carter

unread,
Aug 25, 2010, 11:52:59 PM8/25/10
to orbite...@googlegroups.com
Not sure if that is quite right... if you look at TCPResource.render (this is what gets called each time a client attempts to handshake) you see where an instance of a TCPConnectionResource is created. There should always be one of these created per connection.

Perhaps the lostTriggered is being set improperly elsewhere. I would think that adding a print statement each time its set to True would clear the matter up fast.

-Michae
 
--
You received this message because you are subscribed to the
Orbited discussion group.
To post, send email to
   <orbite...@googlegroups.com>
To unsubscribe, send email to
   <orbited-user...@googlegroups.com>
For more options, visit
   <http://groups.google.com/group/orbited-users>

Niklas B

unread,
Aug 26, 2010, 10:21:35 AM8/26/10
to Orbited Discussion
I've seen this as well (i.e IRC closing by timeout and Orbited not
closing). I think this is to due with the issues with the CSP protocol
not closing properly (also causing the issues on
http://groups.google.com/group/orbited-users/browse_thread/thread/73066ee7e761b447/6f2780655c019acb)

mcarter, I know your busy, but can you check
http://groups.google.com/group/orbited-users/browse_thread/thread/7d5bafd613aea7da
when possible? Then I can try the UTF8+CSP fixes, and we can hopefully
release it and move on to orbited2?

On Aug 26, 5:52 am, Michael Carter <cartermich...@gmail.com> wrote:
> >    <orbited-user...@googlegroups.com<orbited-users%2Bunsubscribe@goo glegroups.com>

SnacksOnAPlane

unread,
Aug 26, 2010, 11:05:57 AM8/26/10
to Orbited Discussion
It's getting called the first time by CometTransport's close method,
in base.py. But that gets called after every write. Shouldn't
connectionLost be called only when the client disconnects?

Here's the stack trace from pdb:
(Pdb) w
/usr/local/bin/orbited(8)<module>()
-> load_entry_point('orbited==0.7.10', 'console_scripts', 'orbited')()
/usr/local/lib/python2.6/dist-packages/orbited-0.7.10-py2.6.egg/
orbited/start.py(183)main()
-> reactor.run()
/usr/local/lib/python2.6/dist-packages/Twisted-10.0.0-py2.6-linux-
i686.egg/twisted/internet/base.py(1170)run()
-> self.mainLoop()
/usr/local/lib/python2.6/dist-packages/Twisted-10.0.0-py2.6-linux-
i686.egg/twisted/internet/base.py(1182)mainLoop()
-> self.doIteration(t)
/usr/local/lib/python2.6/dist-packages/Twisted-10.0.0-py2.6-linux-
i686.egg/twisted/internet/selectreactor.py(140)doSelect()
-> _logrun(selectable, _drdw, selectable, method, dict)
/usr/local/lib/python2.6/dist-packages/Twisted-10.0.0-py2.6-linux-
i686.egg/twisted/python/log.py(84)callWithLogger()
-> return callWithContext({"system": lp}, func, *args, **kw)
/usr/local/lib/python2.6/dist-packages/Twisted-10.0.0-py2.6-linux-
i686.egg/twisted/python/log.py(69)callWithContext()
-> return context.call({ILogContext: newCtx}, func, *args, **kw)
/usr/local/lib/python2.6/dist-packages/Twisted-10.0.0-py2.6-linux-
i686.egg/twisted/python/context.py(59)callWithContext()
-> return self.currentContext().callWithContext(ctx, func, *args,
**kw)
/usr/local/lib/python2.6/dist-packages/Twisted-10.0.0-py2.6-linux-
i686.egg/twisted/python/context.py(37)callWithContext()
-> return func(*args,**kw)
/usr/local/lib/python2.6/dist-packages/Twisted-10.0.0-py2.6-linux-
i686.egg/twisted/internet/selectreactor.py(146)_doReadOrWrite()
-> why = getattr(selectable, method)()
/usr/local/lib/python2.6/dist-packages/Twisted-10.0.0-py2.6-linux-
i686.egg/twisted/internet/tcp.py(460)doRead()
-> return self.protocol.dataReceived(data)
/usr/local/lib/python2.6/dist-packages/Twisted-10.0.0-py2.6-linux-
i686.egg/twisted/protocols/basic.py(251)dataReceived()
-> why = self.lineReceived(line)
/usr/local/lib/python2.6/dist-packages/Twisted-10.0.0-py2.6-linux-
i686.egg/twisted/web/http.py(1573)lineReceived()
-> self.allContentReceived()
/usr/local/lib/python2.6/dist-packages/Twisted-10.0.0-py2.6-linux-
i686.egg/twisted/web/http.py(1641)allContentReceived()
-> req.requestReceived(command, path, version)
/usr/local/lib/python2.6/dist-packages/Twisted-10.0.0-py2.6-linux-
i686.egg/twisted/web/http.py(807)requestReceived()
-> self.process()
/usr/local/lib/python2.6/dist-packages/Twisted-10.0.0-py2.6-linux-
i686.egg/twisted/web/server.py(125)process()
-> self.render(resrc)
/usr/local/lib/python2.6/dist-packages/Twisted-10.0.0-py2.6-linux-
i686.egg/twisted/web/server.py(132)render()
-> body = resrc.render(self)
/usr/local/lib/python2.6/dist-packages/orbited-0.7.10-py2.6.egg/
orbited/transports/base.py(22)render()
-> self.conn.transportOpened(self)
/usr/local/lib/python2.6/dist-packages/orbited-0.7.10-py2.6.egg/
orbited/cometsession.py(324)transportOpened()
-> self.cometTransport.flush()
/usr/local/lib/python2.6/dist-packages/orbited-0.7.10-py2.6.egg/
orbited/transports/base.py(46)flush()
-> self.write(self.packets)
/usr/local/lib/python2.6/dist-packages/orbited-0.7.10-py2.6.egg/
orbited/transports/longpoll.py(29)write()
-> self.close()
/usr/local/lib/python2.6/dist-packages/orbited-0.7.10-py2.6.egg/
orbited/transports/base.py(68)close()
-> self.conn.connectionLost()
> /usr/local/lib/python2.6/dist-packages/orbited-0.7.10-py2.6.egg/orbited/cometsession.py(215)connectionLost()
-> self.logger.debug('do trigger');


On Aug 25, 11:52 pm, Michael Carter <cartermich...@gmail.com> wrote:
> >    <orbited-user...@googlegroups.com<orbited-users%2Bunsubscribe@goo glegroups.com>
Reply all
Reply to author
Forward
0 new messages