Archive

Archive for September, 2010

See you at JavaOne!

September 15th, 2010

With a week-long Scandinavia tour over, my nexgt big week is JavaOne! JavaOne has always been an incredibly busy week for me, but this year is no exception.

  • Sunday before JavaOne, we’ll be having a full day Hackathon at Digg. If you are around, please RSVP and join us.
  • I’ll be presenting a Hudson talk (S313338 – Sep 20th 10am in Parc55). I’ll discuss the current state of the project, then I’ll spend most of the time talking about various techniques on Hudson that goes beyond simple builds & tests.
  • I’ll be on a 15-minute OTN video interview after that.
  • InfraDNA will have a kiosk outside the JavaOne vendor exhibit area. We’ll be showing our value-add Hudson distribution ICHCI, and we’d be happy to answer any Hudson related questions/comments, so please drop by. I should be at the booth most of the time.

I think it’ll be fun, and I certainly look forward to seeing as many of you as I can!

hudson, infradna , ,

Scandinavia Tour 2010

September 11th, 2010


I was traveling for the whole week last week.

My first stop was at Copenhagen. I attended the two-day Hudson/CI workshop hosted by Nokia, and I was very impressed at the degree in which Nokia embraed Hudson and the amount of the Hudson plugin development they’ve done thus far. I hope some of those work will be publicly visible some time (nag, nag.) I also got some inspirations about new plugins, which I hope to implement soon.

We also hosted the Hudson user meetup at the same place Monday night. We had about 20-30 people all in all, which I thought was a great attendance. It looks like there will be a LinkedIn group for Copenhagen Hudson users, so please go join the group if you couldn’t come to the meet-up. Aside from all the conversations that I enjoyed, I was able to discuss and validate some of the ideas that I’m doing in ICHCI, our value-added Hudson distribution.

On more lighter notes, I was finally able to meet Simon Wiest in person, who is a long time Hudson contributer and an author of a German Hudson book.

Simon also “discovered” that Nokia deployed extreme feedback devices throughout their offices, and that their builds are so always green that they only have yellow and red lights. Must be a Scandinavian energy-efficiency thing.

Nokia folks told us that should these lights ever come off, there will be sirens and people will be evacuating the building. Clearly, a broken build is a serious, serious deal :-)

In the later part of the week, I moved to Oslo to attend JavaZone 2010. As usual, JavaZone was very well organized, and aside from everything being twice as expensive than the US, I enjoyed Oslo. The attendance to the meet-up was much smaller here, but nonetheless I had a good 2 hours in a local bar talking about Hudson, life in Norway, and so on. The talk went OK, with all demos working correctly.


One thing that always strikes me in Europe is that how much people drink. Here at JavaZone, they even serve you beer at the conference, which is unthinkable in the US! So when I realized that I had some extra time in the airport, I just couldn’t resist mimicking an European by indulging myself with a glass of beer (at 10am!)

The only regret for me was that I didn’t have much time doing sight-seeing — I would have loved to visit Legoland Denmark or the famous Fjord in Norway — but then, there’s always the next time. For those who I met in person during the travel, it was a great pleasure to meet you. There’s something special about meeting people in person.

hudson, infradna , , ,

Deadlock that you can’t avoid

September 1st, 2010

A seemingly innocent user report in the Hudson IRC channel turns into an interesting “discovery” (for me anyway) about JVM. Namely, if you got two threads initializing classes in the opposite order, you can get into a dead lock.

For this test, I wrote the following class. In this way, initialization of Foo results in the initialization of Bar:

package test;
public class Foo {
    static {
        try {
            System.out.println("Initializing Foo");
            Thread.sleep(3000);
            new Bar();
            System.out.println("Foo initialized");
        } catch (Exception e) {
            throw new Error(e);
        }
    }
}

I then wrote the Bar class that does the opposite:

package test;
public class Bar {
    static {
        try {
            System.out.println("Initializing Bar");
            Thread.sleep(3000);
            new Foo();
            System.out.println("Bar initialized");
        } catch (Exception e) {
            throw new Error(e);
        }
    }
}

Now, if you initialize them simultaneously from the opposite direction like this:

public class App {
    public static void main(String[] args) {
        new Thread() { public void run() { new Foo(); }
        }.start();
        new Thread() { public void run() { new Bar(); }
        }.start();
    }
}

And you’ll see that it deadlocks:

"Thread-1" prio=10 tid=0x0000000040696000 nid=0x2d6e in Object.wait() [0x00007ff087ce5000]
   java.lang.Thread.State: RUNNABLE
	at test.Bar.(Bar.java:11)
	at test.App$2.run(App.java:14)

"Thread-0" prio=10 tid=0x0000000040688000 nid=0x2d6d in Object.wait() [0x00007ff087de6000]
   java.lang.Thread.State: RUNNABLE
	at test.Foo.(Foo.java:11)
	at test.App$1.run(App.java:8)

Obviously, in production code, the path from initialization of class Foo to class Bar will be much longer, but you get the idea. I’m kind of surprised that this isn’t a real widespread problem in JavaEE. Developers don’t normally care about the class initialization, and on the server side you tend to have a lot of threads doing random things…

Uncategorized