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

Gateway Timeout Error in API Subscription Retrieval with High Number of APIs #3056

Open
shavinsenadheera opened this issue Aug 12, 2024 · 0 comments · May be fixed by wso2/carbon-apimgt#12514

Comments

@shavinsenadheera
Copy link

shavinsenadheera commented Aug 12, 2024

Description

This issue involves a 504 Gateway Timeout error when retrieving APIs subscribed by a specific application through a REST API call. This issue occurs when listing an application with over 100 API subscriptions. The logs revealed that the processing time for the call exceeded 4 minutes before the error occurred.

...
There is/are [26] thread(s) in total that are monitored by this Valve and may be stuck., tenantDomain=carbon.super, correlation-id= java.lang.Throwable
    at org.wso2.carbon.user.core.authorization.PermissionTree.updatePermissionTree(PermissionTree.java:1004)
    at org.wso2.carbon.user.core.authorization.PermissionTree.updatePermissionTree(PermissionTree.java:962)
    at org.wso2.carbon.user.core.authorization.JDBCAuthorizationManager.isUserAuthorized(JDBCAuthorizationManager.java:276)
 ...

This issue occurs when listing an application with over 100 API subscriptions. The logs revealed that the processing time for the call exceeded 4 minutes before the error occurred. It was identified that for each API in the subscription list, the following call is made to the database.

In addition to the above, a call to update the permission tree (updatePermissionTree()) is being made for each .rxt resource. So, if there are 5 APIs, then the updatePermissionTree() method would get called for each resource related to each API ["provider.rxt", "api.rxt", "productdocument.rxt", "documentation.rxt", "product.rxt"].

When listing the APIs subscribed to an application, and if that application has a high number of APIs, this would make DB calls based on the number of resources and also the number of APIs. As observed for the customer, with all the calls accumulated, a timeout error would get thrown in such scenarios.

Steps to Reproduce

N/A

Affected Component

Analytics

Version

APIM 4.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
1 participant