Play 2.5 application(deadbolt?) becomes unresponsive

305 views Asked by At

I have recently upgraded to play 2.5. Everything works, until the system gets busy generating reports (in separate threads) when I suddenly am unable to access any page in the web application. I don't see any errors in the log. The play 2.3.8 version works fine under the same circumstances/load. I don't see a solution other then removing deadbolt to see if it fixes the problem, as it did for the users listed below. TIA

deadbolt 2.5.4 "play-authenticate_2.11" % "0.8.1"

I see a couple of other users had a similar problem and had to remove deadbolt to resolve it.

Play framework [2.5.0 java] - Blocked netty-event-loop threads resulting in timeout

Play 2.5 application requests hang

(Feb 8 '17) I am still working on this issue since it fails on two production machines, yet works on two development machines. The development machines are physical and have slightly newer Java versions. The production machines are both virtual and run Java build 1.8.0_66. Once I resolve this issue I will work on tuning the thread pools. I have posted two solutions, both of which worked on two development machines (physical machines with Java > 1.8.0_66).

See https://www.coalliance.org/play-25-upgrade for more information.

1

There are 1 answers

1
Gus On

I've had a similar problem, in my case the app became unresponsive after this error:

PersistenceException: java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 30000ms.

I found out it was a problem with static usage of Ebean in the TokenAction class from play-authenticate, I had to change this:

public static void deleteByUser(final User u, final Type type) {
    QueryIterator<TokenAction> iterator = find.where()
            .eq("targetUser.id", u.id).eq("type", type).findIterate();
    Ebean.delete(iterator);
    iterator.close();
}

To this:

public static void deleteByUser(final User u, final Type type) {
    QueryIterator<TokenAction> iterator = find.where()
            .eq("targetUser.id", u.id).eq("type", type).findIterate();
    while(iterator.hasNext()) {
        iterator.next().delete();
    }
    iterator.close();
}