Integrating RT3 with Subversion

As I have mentioned a few times before, I am a big fan of using BestPractical RT3 for all sorts of things, including, but not limited to, bug tracking during project development.  I see a great benefit in having a single system for both technical support and development departments.  Bugs can be reported by customers, investigated by technical support department, passed on to developers, fixed and tested, and then passed back to technical support department to verify with the customer and resolve.

Needless to say, integrating RT3 with Subversion can be of great benefit.  In this case, not only you will have full history of bug reports, but you’ll also see which code changes were made for each bug report.  Learning from previous bug fixes and having a quick way to see why something was changed is priceless.

Read more to see how RT3 can be integrated with Subversion.  You can also easily adopt the same approach to other version control systems.

Continue reading Integrating RT3 with Subversion

The saga of a lost connection

I came across an interesting problem at work a couple of days ago.  One of our CakePHP-based applications has a scheduled task (cronjob) that runs every minute and imports mail from a number of IMAP mailboxes into the database.  All of a sudden the script broke.  In a very particular way.  Not a single line of code was change in the script itself, and there were no significant changes in the rest of the application that the script is using.  But one day, for some reason, it started to import emails from only half of the mailboxes, completely ignoring the rest.

A lengthy midnight drunk debugging session helped to realize the problem.  Apparently, in the list of mailboxes to check there were a few old mailboxes, which were not used anymore for any email.  The script was checking them but they were always empty.  Server administrator removed those mailboxes during a scheduled maintenance window.  Now, the script couldn’t connect to the mailbox anymore.  No problem, there was error handling for this case.  But was error handling didn’t take into account is the combination of time it takes timeout on the non-existing mailbox check and the database connection timeout.

It so happened, that these few old mailboxes were right in the middle of the list of all mailboxes.  The script was importing mail from the first few mailboxes just fine.  But then while it was taking a long time to timeout on a few non-existing mailboxes, the database connection got closed due to the inactivity timeout.  This wasn’t handled properly.  The script was only checking for the existing database connection at the beginning, when it was opening the connection – not later on.  As the result, nothing could have been imported from the rest of the mailboxes.

As always, once you know the problem, you also know how to fix it or work around it.  But troubleshooting a problem like this is tricky.  Seeing the queries working for one mailbox and not working for another is disorienting at least.  Having no recent changes to the application doesn’t help either.  And the problem being not in the code itself, but in the resources is also not very obvious.

So, here you go.  If you ever have a weird problem like that – check that your resources (database connection, network connection, file handler) are still available to you.

Zip vs. Bzip2

While investigating an unrelated issue on our backup server, I came across an interesting discussion about gzip vs. bzip2. I was surprised to read on how much slower bzip2 is.  I even tested it on our server.  And as expected, I saw the huge difference.

$ du -sh home
819M  home

$ time tar czf test.tar.gz home
real	3m29.741s
user	1m4.026s
sys	0m5.629s

$ time tar cjf test.tar.bz2 home
real	11m38.751s
user	6m19.259s
sys	0m7.237s

$ ll test.tar*
-rw-r--r-- 1 leonid users 365987716 2010-06-29 13:08 test.tar.bz2
-rw-r--r-- 1 leonid users 390655750 2010-06-29 12:56 test.tar.gz

For such a small difference in size, the compression time difference is huge! Of course, I should play with more parameters, repeat the tests several times, and test the decompression time too. But the above test is still a good indication. Way too many scripts out there use the default parameters and substitute gzip with gzip2 without any testing. That’s obviously asking for trouble.

MantisBT vs. RT3

I’ve been praising Best Pratical’s RT3 (aka Request Tracker) for a long time.  So at my new job, given a new start, I thought that I maybe need to explore other options and widen my horizons.  After all, the needs were much less and much simpler.  We just needed a bug tracking application for three people or so and for a single project.  There was a possibility of more people joining the team later and more projects starting up, so I didn’t want to limit ourselves too much.  But immediate needs were quite simple.

After a good look around, I decided to give Mantis Bug Tracker another try.  I remember using it for a bit back when the project just started.  I even remember patching it to fit my needs back then.

During those few years that I haven’t looked at MantisBT it grew and developed quite a bit.  It is a stable, feature-rich, yet simple to manage application.  We’ve used it for the whole two month before our needs changed again and we started looking back at RT3.  Never-the-less I am glad we used it and got experience with another tool.  I got a few ideas out of it, which I will be implementing in our new RT3 installation.  Below are the few things that I loved and hated about the MantisBT.  Maybe you’ll find them useful.

Continue reading MantisBT vs. RT3

Google services via command line

I don’t know how I missed the announcement and why there is no noise around this release, but here it goes.  GoogleCL is a tool that you use from the command line to access Google web services.  I just installed it on my Fedora 13 laptop and its awesome!

Here is what you need to do to intall

$ sudo yum install python-gdata
$ wget http://googlecl.googlecode.com/files/googlecl-0.9.7.tar.gz
$ tar xzvf googlecl-0.9.7.tar.gz
$ cd googlecl-0.9.7
$ sudo python setup.py install

Here are some of the things that you can do.  And I guess more is coming shortly.

The first time you’ll connect to any of the Google web services using this tool, you’ll need to authenticate and grant access to the application.  After that – it’s all pure honey.