Powered By:
Clearspace
BlatherSource: Because development won't keep quiet

Daniel Henninger's BlatherBlog

4 Posts tagged with the twisted tag
14

I've been racking my brain over a bizarre problem I've run into.  I may have posted about it before but I want to post fresh about it regardless.

 

There is an occasional problem that occurs with PyICQt and PyAIMt (specifically.. oscar.py) where outgoing messages are "delayed by one".  By that I mean, lets say you send a message.  It does not leave the machine.  However, when you go to type another message, the typing notification triggers the message to leave, and now the typing notification is stuck.  I have watched these events come into oscar.py, go through everything they need to go through, and "leave my code" via self.transport.write.  At the same time, I'm sitting here watching the network traffic coming from the box and nothing leaves.  (until the next event occurs)  It's only outgoing events too.

 

So here's some misc notes I've made about this:

 

- does not occur with Twisted 1.3.0, started happening in Twisted 2.*

- does not appear to occur with the epoll reactor, but I haven't tested this thoroughly

- thought it was only the poll reactor, but that doesn't appear to be true

- occurs with python 2.2 - 2.4

- can occur on both mac os x and linux

 

I had a thought the other day that perhaps I'm accidentally overriding some important variable that is used by a protocol.Protocol, but that does not appear to be the case.  I did notice that I'm using ClientCreator which in Twisted 1.3.0 was listed as unstable.  Seems to not be in Twisted 2.*.  However, I don't really see anything different there.

 

I find it highly unlikely that my code is NOT causing this in some way, but something beyond my code is where the problem is really occuring.  I would expect to see a lot of posts on the twisted lists if it weren't being caused by my code in some way.

 

Bah, I have no idea what's going on.  I don't have hard facts on this yet, but I believe that it doesn't always "start" like this.  Like occasionally I'll be fine, no delay, and then it will 'come on' at some point.  Then again, maybe it's just that I had events going at the time that were triggering everything to run correctly.

 

My original thought was that I wasn't finishing off my packets to OSCAR in some way and OSCAR was sitting there waiting for me to finish my statement, so to speak.  However, I've been able to observe the messages never leaving in the first place.  So ... bah.

 

I don't feel like I have enough hard facts to put together to bug the twisted community with.  I feel like I'd be saying "well there's something wrong, but I can't prove it".  How useful is that?  =/

 

I don't understand why Twisted 1.3.0 doesn't have this problem.  That part is extremely weird to me.

14 Comments 0 References Permalink
0

The Dance

Posted by Daniel Henninger Jun 1, 2006

Ah Twisted...   I love ya but I hate ya.  Fairly often when there is an update my code no longer works.  So I'm trying to devise a nifty way to be able to test against lots of versions of twisted -without- having to have entirely separate installs.  I've got a couple of options that I'm thinking through:

 

1. Install all versions I can think of, but with something like "Twisted-2.2.0" and a symlink to the twisted directory with some scripts in place to "dance" between versions at my will.

 

2. Build RPMs for all of the pieces/versions and just install/uninstall them on the fly.

 

While 1 might be a more easy way out, I think 2 would be the better way to go.  I'm good at building RPMs so why should I refrain from doing it?  I can't really tell all of my users "you have to upgrade to the latest twisted" every time.  I'll get flogged.  Likewise, it's not always all that easy for folk to do that.

 

I'll think on it.  Probably won't take that long to work out.  Open for other suggestions if anyone has some.

0 Comments 0 References Permalink
8

IRC Transports?

Posted by Daniel Henninger Nov 24, 2005

Ok, so am I the only one who would like to be able to be connected to an IRC server but not actually be in a channel?  Maybe I'm just not looking in the right places, but to date, I have yet to find a transport that offers this functionality.  Basically, all I'd like to do is to be able to connect to, say, irc.freenode.net, and sit there.  I don't really expect a transport to offer the functionality to actually auth using freenode's login bot or whatever it's called, but I'd at least like the opportunity to sit there.  Is there something wrong with that?  Gaim lets me do it.  I'm wondering if I should whip together a quick IRC transport using Twisted.  All of the stuff I need is right there.  I don't have to use ninja magic discovering how a 'closed' protocol works to do it.  I doubt it would take that long.  It would probably be fun.

 

But that would be yet another transport on my plate.  I definitely would not do that until I get PyAIM and PyICQ caught up a tad, if nothing else with each other, but this is definite functionality I want.  ejabbber's built in transport isn't particularly great.  jjigw seems good but doesn't appear to have this functionality yet.  Also, for some reason, I ran into a lot of problems getting it working in the past.  Something about perl modules I couldn't locate on CPAN or something.  shrug  I might be confusing it with something else though.  Either way, I'm to understand it does not support the functionality I want.  Though, I was told that the developers are quite helpful people and might even be interested in it if I talked with them.  There's also an irc transport inside xmpppy.  I haven't figured out what it supports really.  It went from "I'll try it right now" to "crap, I'll do it some other time" when I tried to run it and found it required some other "irclib" piece.  We shall see.

 

I know Twisted has good irc support in it.  It appears to be actively worked on too.

 

Bah...  decisions, decisions...

 

Well Happy Thanksgiving to anyone who celebrates and is reading.  Happy November 24th to those who don't.  =)  I have a goal of getting PyAIM released this weekend.  We shall see how time and that goal work out. 

8 Comments 0 References Permalink
0

So, apparantly I am going to have to do a lot of misc extra work to get the updated oscar.py back into Twisted Words.  That's fine, it just means it'll be a while longer before I do so.  I'm apparantly supposed to set up some unit tests, write up more documentation, and explain what all has changed from the previous version.  While I'm more of the opinion that it would be helpful to at least have a more functionality one there . . . if that's the rules they want to follow that's fine with me.

 

So it shouldn't be too hard to throw together at least some unit tests.  Perhaps a simple log in, send a message, receive it on the other end, and close the connection for starters.  Obviously there's a lot I could test over time, but that's probably a good place to start.  I would have to emulate the server's responses 'locally'.  (Twisted tests are done for a local file system socket that's supposed to pretend to be the actual network connection)

 

As for documentation, the only balk I have there is that I have to learn their documentation style.  Yet another thing I need to devote some time to.  It looks like it's one of those "document internal to the code" type deals, plus I could throw in some extra bonus documentation that's not within the code.  (IE, is not technical looking API documentation, but rather is "how to" type documentation)  I've put together a couple of extra examples that I think I'll submit as well.  Should be a party.

 

The only problem I have with all of this is Twisted seems to be a moving target lately.  It seems like we keep having to do things like "If Twisted > XXX version, import this, if Twisted > YYY but < XXX, import this, else import this" type stuff.  Hopefully that will settle down over time.  That's part of why I'd like to drop Twisted 1.* support.  It would remove most of the needs for such checks.

 

Anyway, back to the incorporation.  The "things that have changed since the original version" is going to be interesting.  A -LOT- has changed.  =)  I'll have to ask what level of detail they want.  Guess I'll get to that when I get to it.  My more pressing need is keeping my PyAIM and PyICQ users happy.

0 Comments 0 References Permalink