Play 2.8.x requests are sometimes routed wrong


I have a big issue with how the requests are routed from the actual https endpoint to the method controller in the sense that sometimes the request from an endpoint does not reach the associated controller method but reaches another one associated to another endpoint.

For the sake of simplicity i will keep the example short


GET        /a                                    controllers.MainController.aMethod(request: Request)
GET        /b                                    controllers.MainController.bMethod(request: Request)


public Result aMethod(Http.Request request) {"aMethod " + request.uri() );

public Result bMethod(Http.Request request) {"bMethod " + request.uri() );

And what we see sometimes in the logs is something like this

2021-08-23 08:39:16	INFO	aMethod /a
2021-08-23 08:39:16	INFO	aMethod /b

So my first thought was that Http.Request object is not thread safe and as soon as the thread pool for requests (default dispatcher ) was set to one the issue disappeared .

I need some help to properly fix this since having 1 thread to handle requests is not feasible in a live scenario.

Thank you

I think i found the problem :

Note: Every request must be served by a distinct instance of your play.mvc.Action. 
If a singleton pattern is used, requests will be routed incorrectly during multiple request scenarios.


i use an action to authenticate and that action was annotated as singleton .