Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No connection tuning parameters for the token generation call (OAuth2 Protected Backends) #3020

Closed
JanithaSampathBandara opened this issue Jul 24, 2024 · 1 comment

Comments

@JanithaSampathBandara
Copy link

Description

Hi Team,

Description

No connection tuning parameters for the token generation calls (OAuth2 Protected Backends). This will lead the PassThroughMessageProcessor thread to wait if there is a delay from the Auth server which will then impact on the Gateway performance and affect the other APIs as well.

We have carried out a load test with a delayed authorization server and could observe the PassThroughMessageProcessor threads are getting hung. Following is the thread stack trace.

PassThroughMessageProcessor-103
State
Runnable
Java Stack
----------
at java.net.SocketInputStream.socketRead0([java.base@11.0.20.1/Native](http://java.base@11.0.20.1/Native) Method)
at java.net.SocketInputStream.socketRead([java.base@11.0.20.1/SocketInputStream.java:115](http://java.base@11.0.20.1/SocketInputStream.java:115))
at java.net.SocketInputStream.read([java.base@11.0.20.1/SocketInputStream.java:168](http://java.base@11.0.20.1/SocketInputStream.java:168))
at java.net.SocketInputStream.read([java.base@11.0.20.1/SocketInputStream.java:140](http://java.base@11.0.20.1/SocketInputStream.java:140))
at org.apache.http.impl.io.SessionInputBufferImpl.streamRead(SessionInputBufferImpl.java:137)
at org.apache.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:153)
at org.apache.http.impl.io.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:280)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:138)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259)
at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:163)
at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:157)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
at org.wso2.carbon.apimgt.gateway.mediators.oauth.client.OAuthClient.generateToken_aroundBody2(OAuthClient.java:138)
at org.wso2.carbon.apimgt.gateway.mediators.oauth.client.OAuthClient.generateToken(OAuthClient.java:91)
at org.wso2.carbon.apimgt.gateway.mediators.oauth.OAuthTokenGenerator.addTokenToCache_aroundBody2(OAuthTokenGenerator.java:109)
at org.wso2.carbon.apimgt.gateway.mediators.oauth.OAuthTokenGenerator.addTokenToCache(OAuthTokenGenerator.java:107)
at org.wso2.carbon.apimgt.gateway.mediators.oauth.OAuthTokenGenerator.generateToken_aroundBody0(OAuthTokenGenerator.java:72)
at org.wso2.carbon.apimgt.gateway.mediators.oauth.OAuthTokenGenerator.generateToken(OAuthTokenGenerator.java:49)
at org.wso2.carbon.apimgt.gateway.mediators.oauth.OAuthMediator.mediate_aroundBody4(OAuthMediator.java:135)
at org.wso2.carbon.apimgt.gateway.mediators.oauth.OAuthMediator.mediate(OAuthMediator.java:73)
at org.apache.synapse.mediators.ext.ClassMediator.mediate(ClassMediator.java:97)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:108)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71)
at org.apache.synapse.mediators.filters.FilterMediator.mediate(FilterMediator.java:171)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:108)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
at org.apache.synapse.rest.Resource.process(Resource.java:327)
at org.apache.synapse.rest.API.process(API.java:453)
at org.apache.synapse.rest.RESTRequestHandler.apiProcessNonDefaultStrategy(RESTRequestHandler.java:146)
at org.apache.synapse.rest.RESTRequestHandler.identifyAPI(RESTRequestHandler.java:166)
at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:97)
at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:73)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:336)
at org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:99)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:390)
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:211)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker([java.base@11.0.20.1/ThreadPoolExecutor.java:1128](http://java.base@11.0.20.1/ThreadPoolExecutor.java:1128))
at java.util.concurrent.ThreadPoolExecutor$Worker.run([java.base@11.0.20.1/ThreadPoolExecutor.java:628](http://java.base@11.0.20.1/ThreadPoolExecutor.java:628))
at java.lang.Thread.run([java.base@11.0.20.1/Thread.java:829](http://java.base@11.0.20.1/Thread.java:829))

Regards,
Janitha

Steps to Reproduce

  1. Create an API.
  2. Secure the backend endpoint with OAuth 2.0 [1] by setting a delayed authorization server.
  3. Perform a load test on above created API.

[1]https://apim.docs.wso2.com/en/3.2.0/learn/design-api/endpoints/endpoint-security/oauth-2.0/#securing-an-endpoint-with-oauth-20-in-wso2-api-manager

Affected Component

APIM

Version

3.2.0

Environment Details (with versions)

No response

Relevant Log Output

No response

Related Issues

No response

Suggested Labels

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants