-
Notifications
You must be signed in to change notification settings - Fork 644
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
Make transport cleanup configurable #13064
base: master
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThis pull request adds a new constant to the API management gateway constants and modifies the Changes
Sequence Diagram(s)sequenceDiagram
participant BA as BasicAuthCredentialValidator
participant SP as System Properties
participant SC as ServiceClient Options
BA->>SP: Get property "autoTransportOperationCleanUp"
alt Property exists
BA->>SC: Set auto cleanup option based on property value
else
BA->>SC: Proceed with default configuration
end
Assessment against linked issues
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
components/apimgt/org.wso2.carbon.apimgt.gateway/src/main/java/org/wso2/carbon/apimgt/gateway/handlers/security/basicauth/BasicAuthCredentialValidator.java (1)
98-102
: Optimize the system property check by retrieving the value once.The code makes two separate calls to retrieve the same system property. This is inefficient and could be optimized.
-if (System.getProperty(APIMgtGatewayConstants.AUTO_TRANSPORT_OPERATION_CLEANUP) != null) { - options.setProperty(ServiceClient.AUTO_OPERATION_CLEANUP, - Boolean.parseBoolean( - System.getProperty(APIMgtGatewayConstants.AUTO_TRANSPORT_OPERATION_CLEANUP))); +String autoCleanupPropertyValue = System.getProperty(APIMgtGatewayConstants.AUTO_TRANSPORT_OPERATION_CLEANUP); +if (autoCleanupPropertyValue != null) { + boolean autoCleanup = Boolean.parseBoolean(autoCleanupPropertyValue); + options.setProperty(ServiceClient.AUTO_OPERATION_CLEANUP, autoCleanup); + if (log.isDebugEnabled()) { + log.debug("Setting ServiceClient.AUTO_OPERATION_CLEANUP to " + autoCleanup); + } }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
components/apimgt/org.wso2.carbon.apimgt.gateway/src/main/java/org/wso2/carbon/apimgt/gateway/APIMgtGatewayConstants.java
(1 hunks)components/apimgt/org.wso2.carbon.apimgt.gateway/src/main/java/org/wso2/carbon/apimgt/gateway/handlers/security/basicauth/BasicAuthCredentialValidator.java
(2 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
components/apimgt/org.wso2.carbon.apimgt.gateway/src/main/java/org/wso2/carbon/apimgt/gateway/handlers/security/basicauth/BasicAuthCredentialValidator.java (1)
components/apimgt/org.wso2.carbon.apimgt.gateway/src/main/java/org/wso2/carbon/apimgt/gateway/APIMgtGatewayConstants.java (1)
APIMgtGatewayConstants
(22-202)
🔇 Additional comments (1)
components/apimgt/org.wso2.carbon.apimgt.gateway/src/main/java/org/wso2/carbon/apimgt/gateway/APIMgtGatewayConstants.java (1)
183-183
: Looks good - new constant for configurable transport cleanup.This constant introduces the system property that allows users to configure the auto-cleanup process for transport operations, aligning with the PR objective.
Fix: wso2/api-manager#3806
Make the auto-cleanup process configurable by introducing a system property,
autoTransportOperationCleanUp
. You can control whether to enable the auto-cleanup process when starting the API-M. Setting this property to false will disable the auto-cleanup mechanism.ex. ./wso2server.sh -DautoTransportOperationCleanUp=false