1

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.

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
Chet
  • 96
  • 8
  • 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 [here](https://www.playframework.com/documentation/2.5.x/ThreadPools#Many-specific-thread-pools) – Steve Chaloner Feb 06 '17 at 09:37
  • Default thread pool config changed between Play 2.3 and 2.4 so you may be seeing a side-effect of this. See [here](https://playframework.com/documentation/2.5.x/Migration24#thread-pool-configuration) for details. – Steve Chaloner Feb 06 '17 at 09:41
  • 1
    Thanks for your reply, I will do as you suggest and let you know. – Chet Feb 06 '17 at 15:58
  • 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 Feb 06 '17 at 21:08
  • Excellent, thanks! – Steve Chaloner Feb 06 '17 at 23:12
  • 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 workd on two development machines (physical machines with Java > 1.8.0_66) https://www.coalliance.org/play-25-upgrade – Chet Feb 08 '17 at 20:47

1 Answers1

0

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();
}
Gus
  • 4,437
  • 2
  • 24
  • 27
  • Thanks for the response,This is really good information, I will file it away for future problems. I worked on Steve's reply first and it seemed to be the exact issue I was dealing with. – Chet Feb 08 '17 at 22:39