Skip to content

Fix losing expose ports for connectors on local environments#14177

Merged
hashhar merged 1 commit intotrinodb:masterfrom
vlad-lyutenko:vlad-lyutenko/fixed_port_for_connectors
Oct 10, 2022
Merged

Fix losing expose ports for connectors on local environments#14177
hashhar merged 1 commit intotrinodb:masterfrom
vlad-lyutenko:vlad-lyutenko/fixed_port_for_connectors

Conversation

@vlad-lyutenko
Copy link
Copy Markdown
Contributor

@vlad-lyutenko vlad-lyutenko commented Sep 18, 2022

Description

This PR contains fix which prevents lose exposed ports, for functionality introduced in this PR:
#14037

Non-technical explanation

Release notes

(x) This is not user-visible and no release notes are required.
( ) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text:

# Section
* Fix some things. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Sep 18, 2022
@vlad-lyutenko vlad-lyutenko changed the title Vlad lyutenko/fixed port for connectors Expose fixed port for connectors Sep 19, 2022
@vlad-lyutenko vlad-lyutenko changed the title Expose fixed port for connectors Expose fixed port for connectors on local environments Sep 19, 2022
@vlad-lyutenko vlad-lyutenko changed the title Expose fixed port for connectors on local environments Expose fixed ports for connectors on local environments Sep 19, 2022
Copy link
Copy Markdown
Member

@hashhar hashhar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea looks good but I think the mechanism can be simplified.

cc: @ebyhr

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Extract constant for image name.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is one of the examples where we should consider using an environment variable to decide whether to bind to fixed or random port.

Multiple booleans side by side + 1 additional constructor (meant to be used only in *QueryRunner class) seems a little more work than required.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it could be done as a follow up?

@vlad-lyutenko vlad-lyutenko force-pushed the vlad-lyutenko/fixed_port_for_connectors branch from 3bc726c to ec2292d Compare October 5, 2022 15:39
@vlad-lyutenko vlad-lyutenko changed the title Expose fixed ports for connectors on local environments Fix losing expose ports for connectors on local environments Oct 5, 2022
@vlad-lyutenko vlad-lyutenko requested a review from hashhar October 5, 2022 15:42
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix for method exposing port on local environment 

This fix prevents loosing ports which were exposed
after we call this method

I couldn't understand what was wrong. I ran PostgreSqlQueryRunner with/without this commit, but the result looks same to me. Could you describe more details?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ebyhr
Call to this method add some override rules, which will be executed later.
So it's possible such situation.

  1. we collect current expose ports by calling this method (but not yet execute it)
  2. .... add more expose ports in other code ....
  3. actually apply overrides but only with values from 1) missing values from 2)

With Postgres it works because all exposed ports was added before 1)

Copy link
Copy Markdown
Member

@hashhar hashhar Oct 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vlad-lyutenko can you add some of this detailed context to the commit message?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Copy Markdown
Member

@hashhar hashhar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM % commit message

This fix prevents loosing ports, which could be added
as exposed, between call this method
and actual execution of applying override rules
@vlad-lyutenko vlad-lyutenko force-pushed the vlad-lyutenko/fixed_port_for_connectors branch from ec2292d to a225c60 Compare October 6, 2022 08:51
@hashhar hashhar merged commit 1052d1b into trinodb:master Oct 10, 2022
@github-actions github-actions bot added this to the 400 milestone Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

5 participants