Skip to content
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

MINOR: improve logging of tasks on shutdown #7597

Merged
merged 10 commits into from
Oct 29, 2019

Conversation

ableegoldman
Copy link
Contributor

The current logging during a close/shutdown claims to list all active tasks but in fact lists only the running and suspended ones. Likewise it lists only the running standby tasks.

Also changed the name of AssignedTasks#close to shutdown as that more accurately reflects its current (and only) usage

@ableegoldman
Copy link
Contributor Author

@@ -510,6 +510,17 @@ void clear() {
suspended.clear();
}

@Override
public void shutdown(final boolean clean) {
log.debug("Shutting down all active tasks in" + "\n" +
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: in {} mode" + and add clean boolean?.

Ditto otherwise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ack

@ableegoldman ableegoldman force-pushed the MINOR-improve-TM-shutdown-logging branch from 357988d to e3e927a Compare October 25, 2019 03:18
@mjsax mjsax added the streams label Oct 25, 2019
Copy link
Member

@mjsax mjsax left a comment

Choose a reason for hiding this comment

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

LGTM.

@mjsax
Copy link
Member

mjsax commented Oct 25, 2019

Java 11 / 2.13 failed with env issue. Other two runs passed.

Retest this please.

@@ -72,7 +72,8 @@
this.eosEnabled = StreamsConfig.EXACTLY_ONCE.equals(config.getString(StreamsConfig.PROCESSING_GUARANTEE_CONFIG));
this.stateDirectory = stateDirectory;

this.logPrefix = String.format("%s [%s] ", isStandby ? "standby-task" : "task", id);
final String threadIdPrefix = String.format("stream-thread [%s] ", Thread.currentThread().getName());
this.logPrefix = threadIdPrefix + String.format("%s [%s] ", isStandby ? "standby-task" : "task", id);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mjsax @guozhangwang Just added this to the PR, what do you think about including the thread id in the prefix (not just the task)? I can split this into a separate PR if you want to just get this one merged, there may be some other places/classes where this would be useful as well.

Copy link
Member

Choose a reason for hiding this comment

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

SGTM to add it in this PR.

@mjsax mjsax merged commit 56bc507 into apache:trunk Oct 29, 2019
mjsax pushed a commit that referenced this pull request Oct 29, 2019
Reviewers: Guozhang Wang <guozhang@confluent.io>, Matthias J. Sax <matthias@confluent.io>
@mjsax
Copy link
Member

mjsax commented Oct 29, 2019

Merged to trunk and cherry-picked to 2.4.

ijuma added a commit to confluentinc/kafka that referenced this pull request Nov 3, 2019
Fixed a minor conflict in `.gitignore` and fix compiler
errors in KafkaUtilities due to `PartitionReplicaAssignment`
rename to `ReplicaAssignment`.

* apache-github/trunk: (34 commits)
  HOTFIX: Try to complete Send even if no bytes were written (apache#7622)
  KAFKA-9080: Revert the check added to validate non-compressed record batch does have continuous incremental offsets
  KAFKA-8972 (2.4 blocker): TaskManager state should always be updated after rebalance (apache#7620)
  MINOR: Fix Kafka Streams JavaDocs with regard to new StreamJoined class (apache#7627)
  MINOR: Fix sensor retrieval in stand0by task's constructor (apache#7632)
  MINOR: Replace some Java 7 style code with Java 8 style (apache#7623)
  KAFKA-8868: Generate SubscriptionInfo protocol message (apache#7248)
  MINOR: Correctly mark offset expiry in GroupMetadataManager's OffsetExpired metric
  KAFKA-8972 (2.4 blocker): bug fix for restoring task (apache#7617)
  KAFKA-9093: NullPointerException in KafkaConsumer with group.instance.id (apache#7590)
  KAFKA-8980: Refactor state-store-level streams metrics (apache#7584)
  MINOR: Fix documentation for updateCurrentReassignment (apache#7611)
  MINOR: Preserve backwards-compatibility by renaming the AlterPartitionReassignment metric to PartitionReassignment
  KAFKA-8972 (2.4 blocker): clear all state for zombie task on TaskMigratedException (apache#7608)
  KAFKA-9077: Fix reading of metrics of Streams' SimpleBenchmark (apache#7610)
  KAFKA-8972 (2.4 blocker): correctly release lost partitions during consumer.unsubscribe() (apache#7441)
  MINOR: improve logging of tasks on shutdown (apache#7597)
  KAFKA-9048 Pt1: Remove Unnecessary lookup in Fetch Building (apache#7576)
  MINOR: Fix command examples in kafka-reassign-partitions.sh docs (apache#7583)
  KAFKA-9102; Increase default zk session timeout and replica max lag [KIP-537] (apache#7596)
  ...
ableegoldman pushed a commit to ableegoldman/kafka that referenced this pull request Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants