-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
fix: postgres plugin blocking call #36046
fix: postgres plugin blocking call #36046
Conversation
WalkthroughThe changes involve a modification in the Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 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
Early access features: disabledWe are currently testing the following features in early access:
Note:
|
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
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- app/server/appsmith-plugins/postgresPlugin/src/main/java/com/external/plugins/PostgresPlugin.java (1 hunks)
Additional comments not posted (2)
app/server/appsmith-plugins/postgresPlugin/src/main/java/com/external/plugins/PostgresPlugin.java (2)
657-657
: Good catch! The change to useflatMap
is correct.Since the lambda passed to
flatMap
returns aMono
, usingflatMap
instead ofmap
is the right choice. This change is approved.
658-661
: Excellent refactoring! The condensed lambda expression improves readability.The updated version condenses the verbose structure into a single line using a streamlined lambda expression. This enhances code readability without altering the underlying functionality. The control flow of retrieving the maximum pool size and creating the connection pool accordingly remains intact.
This refactoring is a nice improvement. The changes are approved.
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
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- app/server/appsmith-plugins/postgresPlugin/src/main/java/com/external/plugins/PostgresPlugin.java (1 hunks)
Additional comments not posted (1)
app/server/appsmith-plugins/postgresPlugin/src/main/java/com/external/plugins/PostgresPlugin.java (1)
657-661
: Excellent work! The code changes look great.The changes enhance the
datasourceCreate
method by:
- Using
flatMap
to elegantly chain theMono
for max pool size with pool creation logic- Deferring pool creation until subscription using
Mono.fromCallable
- Bumping logging level to
info
which is more suitableKeep up the good work!
## Description This PR resolves the blockhound callout `Blocking call! java.io.FileInputStream#readBytes` in the /v1/actions/execute (POST) API call when used with Postgres Plugin. This blocking call was present in the PostgresPlugin.java Fixes appsmithorg#36008 ## Automation /ok-to-test tags="@tag.Sanity" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!IMPORTANT] > 🟣 🟣 🟣 Your tests are running. > Tests running at: <https://github.com/appsmithorg/appsmith/actions/runs/10666128697> > Commit: 9224297 > Workflow: `PR Automation test suite` > Tags: `@tag.Sanity` > Spec: `` > <hr>Mon, 02 Sep 2024 11:19:10 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Chores** - Improved the readability and conciseness of the connection pool creation logic in the Postgres plugin, enhancing maintainability without affecting functionality. - Updated logging level from debug to info for better clarity on log messages. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Description
This PR resolves the blockhound callout
Blocking call! java.io.FileInputStream#readBytes
in the /v1/actions/execute (POST) API call when used with Postgres Plugin.This blocking call was present in the PostgresPlugin.java
Fixes #36008
Automation
/ok-to-test tags="@tag.Sanity"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10666128697
Commit: 9224297
Cypress dashboard.
Tags:
@tag.Sanity
Spec:
Mon, 02 Sep 2024 11:40:16 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit