Skip to content

[LI-HOTFIX] Add debugger to print resolved IPs, and assign clientId to ProducerConfig - #352

Merged
fluffywei merged 1 commit into
2.4-lifrom
gcn_36959
Jun 9, 2022
Merged

[LI-HOTFIX] Add debugger to print resolved IPs, and assign clientId to ProducerConfig#352
fluffywei merged 1 commit into
2.4-lifrom
gcn_36959

Conversation

@fluffywei

@fluffywei fluffywei commented Jun 8, 2022

Copy link
Copy Markdown

Added debugger to print resolved IPs; assigned the self generated producer clientId to ProducerConfig when users haven't provided one.

EXIT_CRITERIA = When gets to the root of how the client’s DNS resolver gets it’s IPs in a kafka clients test in EI cluster

More detailed description of your change,
if necessary. The PR title and PR message become
the squashed commit message, so use a separate
comment to ping reviewers.

Summary of testing strategy (including rationale)
for the feature or bug fix. Unit and/or integration
tests are expected for any behaviour change and
system tests should be considered for larger changes.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

…ducer clientId to ProducerConfig when users haven't provided one.
@fluffywei
fluffywei requested a review from kehuum June 8, 2022 17:11
InetAddress[] addresses = InetAddress.getAllByName(host);
log.debug("Resolved {} and got addresses: ", host);
for (InetAddress address: addresses) {
log.debug(address.getHostAddress() + ";");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this getHostAddress prints the actual resolved host name, not the bootstrap dns disco address, right?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

getHostAddress returns the IP address string in textual presentation.

this.clientId = buildClientId(configuredClientId, transactionalId);

if (configuredClientId.isEmpty()) {
config.originals().put(ProducerConfig.CLIENT_ID_CONFIG, this.clientId);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

what's the usage for this? If user didn't supply a client.id, the printed configs will have client.id as empty field?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yes, when users didn't config client.id, kafka clients will self generate it and the ProducerConfig values result will be: client.id =

@@ -111,6 +111,10 @@ public static ChannelBuilder createChannelBuilder(AbstractConfig config, Time ti

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit: you'll need to follow the pr format for kafka repos, similar to #329

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks, modified the format. Lemme know if further adjustment is needed.

@fluffywei fluffywei changed the title Add debugger to print resolved IPs, and assign clientId to ProducerConfig [LI-HOTFIX] Add debugger to print resolved IPs, and assign clientId to ProducerConfig Jun 9, 2022
@fluffywei
fluffywei merged commit e7696df into 2.4-li Jun 9, 2022
@fluffywei
fluffywei deleted the gcn_36959 branch June 9, 2022 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants