1
votes

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
By default, Deadbolt uses HttpExecution.defaultContext() as its execution context. If you write your own DeadboltExecutionContextProvider implementation to use a custom thread pool and bind it in a module, Deadbolt will use that instead. Could you try and let me know? You can find details on configuring thread pools hereSteve Chaloner
Default thread pool config changed between Play 2.3 and 2.4 so you may be seeing a side-effect of this. See here for details.Steve Chaloner
Thanks for your reply, I will do as you suggest and let you know.Chet
I installed the default akka config (in above link) and it fixed the problem. I have also created a CustomDeadboltExecutionContextProvider and will play with it using the default play 2.5 config. If I find something that works better I will post it here.Chet
Excellent, thanks!Steve Chaloner

1 Answers

0
votes

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();
}