Skip to content

Conversation

@aljoscha
Copy link
Contributor

Before, the flag was changed outside the lock, which would allow the
case that the flag is set to true while someone else is holding the
"close lock".

Before, the flag was changed outside the lock, which would allow the
case that the flag is set to true while someone else is holding the
"close lock".
@becketqin
Copy link
Contributor

Thanks for the patch, Aljoscha. LGTM.

@flinkbot
Copy link
Collaborator

Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.

Automated Checks

Last check on commit c38ce62 (Thu May 14 12:12:01 UTC 2020)

Warnings:

  • No documentation files were touched! Remember to keep the Flink docs up to date!
  • This pull request references an unassigned Jira ticket. According to the code contribution guide, tickets need to be assigned before starting with the implementation work.

Mention the bot in a comment to re-run the automated checks.

Review Progress

  • ❓ 1. The [description] looks good.
  • ❓ 2. There is [consensus] that the contribution should go into to Flink.
  • ❓ 3. Needs [attention] from.
  • ❓ 4. The change fits into the overall [architecture].
  • ❓ 5. Overall code [quality] is good.

Please see the Pull Request Review Guide for a full explanation of the review process.

Details
The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commands
The @flinkbot bot supports the following commands:

  • @flinkbot approve description to approve one or more aspects (aspects: description, consensus, architecture and quality)
  • @flinkbot approve all to approve all aspects
  • @flinkbot approve-until architecture to approve everything until architecture
  • @flinkbot attention @username1 [@username2 ..] to require somebody's attention
  • @flinkbot disapprove architecture to remove an approval you gave earlier

@flinkbot
Copy link
Collaborator

flinkbot commented May 14, 2020

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run travis re-run the last Travis build
  • @flinkbot run azure re-run the last Azure build

aljoscha added 2 commits May 14, 2020 14:44
For debugging FLINK-16383 we need to see who closes a Producer to try
and match the "already closed" exceptions.
This should be disabled again after FLINK-16383 has been resolved.
@aljoscha
Copy link
Contributor Author

@becketqin I added some debug logging.

Copy link
Contributor

@StephanEwen StephanEwen left a comment

Choose a reason for hiding this comment

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

Good with one minor comment.

closed = true;
synchronized (producerClosingLock) {
kafkaProducer.close();
LOG.debug("Closed internal KafkaProducer {}. Stacktrace: {}", System.identityHashCode(this), Joiner.on("\n").join(Thread.currentThread().getStackTrace()));
Copy link
Contributor

Choose a reason for hiding this comment

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

This uses eager string concatenation in a lazy parameter, which is typically a blocker.
Now, this is not a performance critical path, but I would still suggest to avoid this, because it sets a bad example for other contributors to immitate (in then more critical parts).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's why I left it there but I agree that we should set good examples? So I should put an if (LOG.isDebugEnabled()) {} around it?

@aljoscha aljoscha closed this May 14, 2020
@aljoscha aljoscha deleted the flink-16383-kafka-close-lock branch May 14, 2020 14:13
@aljoscha
Copy link
Contributor Author

Thanks for the swift reviews!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants