-
Notifications
You must be signed in to change notification settings - Fork 138
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
Adding connector http timeout in the connector level #1835
Conversation
LGTM |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1835 +/- ##
============================================
- Coverage 81.87% 81.80% -0.07%
+ Complexity 5685 5640 -45
============================================
Files 545 545
Lines 22939 22913 -26
Branches 2364 2349 -15
============================================
- Hits 18781 18745 -36
- Misses 3216 3229 +13
+ Partials 942 939 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Dhrubo Saha <dhrubo@amazon.com>
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.
Once the ClientConfig is set in the connector, have you checked if this config can be updated using the UpdateConnector API? If not, we should add this field in the Update API to allow updates.
private Integer readTimeout; | ||
|
||
@Builder(toBuilder = true) | ||
public ConnectorClientConfig( |
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.
Should we add a checkup here for the values? It seems all values are allowed to build this clientConfig. In some cases we should block CX to use a super large timeout value to avoid malicious requests?
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.
Good point. I'll start a thread on this with our security engineer. If there's anything we need to address, we can do that in the following PR.
Yup, I tested withing providing the following body in the update request. It successfully updates the values.
|
@@ -248,6 +266,13 @@ public void writeTo(StreamOutput output) throws IOException { | |||
} | |||
output.writeBoolean(dryRun); | |||
output.writeBoolean(updateConnector); | |||
if (connectorClientConfig != null) { |
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.
Maybe add a version filter here to avoid bwc issue?
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.
We have default values here. Could you please explain a bit more why BWC issue could happen here?
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.
It's not because if there is value or not, it's because you are introduce new field here. If a master node with this version sends this input to a older data node, it will throw an exception due to cannot process
@@ -277,5 +302,8 @@ public MLCreateConnectorInput(StreamInput input) throws IOException { | |||
} | |||
dryRun = input.readBoolean(); | |||
updateConnector = input.readBoolean(); | |||
if (input.readBoolean()) { |
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.
Same here, you might need to consider add a version filter
Approved with major concern: we need to add a version filter to check the input/output stream version in order to avoid bwc issue before this code deployed to prod. According to the code owner, in this case he will publish a separate PR for this version filter in 2.x branch, because in main branch 2.13 version is not ready due to some unknown issue. |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-1835-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 25f21223367fb334d1276b2543adfa9357d1322e
# Push it to GitHub
git push --set-upstream origin backport/backport-1835-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-1835-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 25f21223367fb334d1276b2543adfa9357d1322e
# Push it to GitHub
git push --set-upstream origin backport/backport-1835-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-1835-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 25f21223367fb334d1276b2543adfa9357d1322e
# Push it to GitHub
git push --set-upstream origin backport/backport-1835-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x Then, create a pull request where the |
…ect#1835) * working on connector http timeout Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * adding more test + fixing integration test issue Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * updating default values Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * fixing unit tests Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * input format changed Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * removed unused code Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * fixing test Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * refactored more and add more tests Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * applying spotlessApply Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * addressing comments Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * removing spaces Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * addressed comments + updated open api model name and endpoints (deprecated) Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * updating test Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * adding fields Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * addresseing comments to rename client config Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> --------- Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> (cherry picked from commit 25f2122)
…ect#1835) * working on connector http timeout Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * adding more test + fixing integration test issue Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * updating default values Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * fixing unit tests Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * input format changed Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * removed unused code Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * fixing test Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * refactored more and add more tests Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * applying spotlessApply Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * addressing comments Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * removing spaces Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * addressed comments + updated open api model name and endpoints (deprecated) Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * updating test Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * adding fields Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * addresseing comments to rename client config Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> --------- Signed-off-by: Dhrubo Saha <dhrubo@amazon.com>
…1835) (#2183) * Adding connector http timeout in the connector level (#1835) * working on connector http timeout Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * adding more test + fixing integration test issue Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * updating default values Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * fixing unit tests Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * input format changed Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * removed unused code Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * fixing test Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * refactored more and add more tests Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * applying spotlessApply Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * addressing comments Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * removing spaces Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * addressed comments + updated open api model name and endpoints (deprecated) Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * updating test Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * adding fields Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * addresseing comments to rename client config Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> --------- Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * fix compilation issue Signed-off-by: zane-neo <zaniu@amazon.com> --------- Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> Signed-off-by: zane-neo <zaniu@amazon.com> Co-authored-by: Dhrubo Saha <dhrubo@amazon.com>
…ect#1835) * working on connector http timeout Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * adding more test + fixing integration test issue Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * updating default values Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * fixing unit tests Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * input format changed Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * removed unused code Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * fixing test Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * refactored more and add more tests Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * applying spotlessApply Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * addressing comments Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * removing spaces Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * addressed comments + updated open api model name and endpoints (deprecated) Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * updating test Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * adding fields Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * addresseing comments to rename client config Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> --------- Signed-off-by: Dhrubo Saha <dhrubo@amazon.com>
…ect#1835) * working on connector http timeout Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * adding more test + fixing integration test issue Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * updating default values Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * fixing unit tests Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * input format changed Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * removed unused code Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * fixing test Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * refactored more and add more tests Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * applying spotlessApply Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * addressing comments Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * removing spaces Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * addressed comments + updated open api model name and endpoints (deprecated) Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * updating test Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * adding fields Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> * addresseing comments to rename client config Signed-off-by: Dhrubo Saha <dhrubo@amazon.com> --------- Signed-off-by: Dhrubo Saha <dhrubo@amazon.com>
@@ -156,6 +156,9 @@ public class CommonValue { | |||
+ AbstractConnector.CREDENTIAL_FIELD | |||
+ "\" : {\"type\": \"flat_object\"},\n" | |||
+ " \"" | |||
+ AbstractConnector.CLIENT_CONFIG_FIELD |
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.
Should bump ML_CONNECTOR_SCHEMA_VERSION
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.
Fixed in PR #2228
Description
[Adding connector http timeout in the connector level]
Issues Resolved
[List any issues this PR will resolve]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.