eclipse-ee4j / eclipse-ee4j/jersey

First call slow between RESOURCE_METHOD_START and real invoke()

Open
#5,259 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

Java : 8
Jersey : 2.35
Spring : 5.1.5.RELEASE
com.google.appengine.tools : 0.8.2

On my production server, first call of my REST API took a while.
After a lot of research, it seems that something happen in Jersey at ResourceMethodInvoker class.

The ResourceMethodInvoker class in method invoke calls `context.triggerEvent(RequestEvent.Type.RESOURCE_METHOD_START); `
then `this.dispatcher.dispatch(resource, context.request());` and finally, calls `AbstractJavaResourceMethodDispatcher.invoke() `which create `invokeMethodAction`

For some reason, the first call in production can take 2 secondes between the `triggerEvent` and `invokeMethodAction`
In logs, i see `RESOURCE_METHOD_START`, but only 2 secondes after, i really enter in my Controller.

The second call is faster and took only some ms.

What happen ? Is it normal ?

Any idea ?

Thanks.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.