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: Avoid dividing by zero #7143

Merged
merged 1 commit into from Aug 3, 2019

Conversation

@mjsax
Copy link
Member

commented Aug 1, 2019

IntelliJ showed a warning about it...

This affects 2.3, 2.2, and 2.1 and we should backport the fix.

@mjsax mjsax added the streams label Aug 1, 2019

final int commitPerRequested = taskManager.maybeCommitActiveTasksPerUserRequested();
if (commitPerRequested > 0) {
committed = taskManager.maybeCommitActiveTasksPerUserRequested();
if (committed > 0) {
final long requestCommitLatency = advanceNowAndComputeLatency();
commitSensor.record(requestCommitLatency / (double) committed, now);

This comment has been minimized.

Copy link
@mjsax

mjsax Aug 1, 2019

Author Member

The problem was here: committed could be zero without this fix.

This comment has been minimized.

Copy link
@ableegoldman

ableegoldman Aug 1, 2019

Contributor

Seems like this should have noticeably screwed up these metrics, do we think this branch is just rarely seen or no one has noticed somehow?

This comment has been minimized.

Copy link
@mjsax

mjsax Aug 1, 2019

Author Member

I think it's rarely executed. Only if a PAPI user request committing via context.commit(), what is expected to be rarely used feature.

@mjsax

This comment has been minimized.

Copy link
Member Author

commented Aug 1, 2019

@abbccdda
Copy link
Contributor

left a comment

LGTM!

@cadonna
cadonna approved these changes Aug 1, 2019
Copy link
Contributor

left a comment

Thank you @mjsax!
LGTM

@bbejeck
bbejeck approved these changes Aug 1, 2019
@bbejeck

This comment has been minimized.

Copy link
Contributor

commented Aug 1, 2019

retest this please

@mjsax

This comment has been minimized.

Copy link
Member Author

commented Aug 1, 2019

Java 11 / 2.13 and Java8 failed with know flaky tests (tracked in Jira). Java 11 / 2.12 passed.

Retest this please.

@mjsax

This comment has been minimized.

Copy link
Member Author

commented Aug 2, 2019

Java8 passed.

Retest this please.

@mjsax

This comment has been minimized.

Copy link
Member Author

commented Aug 3, 2019

Java 11 / 2.13 and Java 8 passed.

Java 11 / 2.12 passed in a previous run. Merging.

@mjsax mjsax merged commit 320f7b0 into apache:trunk Aug 3, 2019

2 of 3 checks passed

JDK 11 and Scala 2.12 FAILURE 11790 tests run, 67 skipped, 1 failed.
Details
JDK 11 and Scala 2.13 SUCCESS 11790 tests run, 67 skipped, 0 failed.
Details
JDK 8 and Scala 2.11 SUCCESS 11790 tests run, 67 skipped, 0 failed.
Details

@mjsax mjsax deleted the mjsax:hotfix-divide-by-zero branch Aug 3, 2019

mjsax added a commit that referenced this pull request Aug 3, 2019
MINOR: Avoid dividing by zero (#7143)
Reviews: A. Sophie Blee-Goldman <sophie@confluent.io>, Bill Bejeck <bill@confluent.io>, Bruno Cadonna <bruno@confluent.io>, Boyang Chen <boyang@confluent.io>, Guozhang Wang <guozhang@confluent.io>
@mjsax

This comment has been minimized.

Copy link
Member Author

commented Aug 3, 2019

Merged to trunk and cherry-picked to 2.3, 2.2, and 2.1.

mjsax added a commit that referenced this pull request Aug 3, 2019
MINOR: Avoid dividing by zero (#7143)
Reviews: A. Sophie Blee-Goldman <sophie@confluent.io>, Bill Bejeck <bill@confluent.io>, Bruno Cadonna <bruno@confluent.io>, Boyang Chen <boyang@confluent.io>, Guozhang Wang <guozhang@confluent.io>
mapr-devops pushed a commit to mapr/kafka that referenced this pull request Aug 4, 2019
MINOR: Avoid dividing by zero (apache#7143)
Reviews: A. Sophie Blee-Goldman <sophie@confluent.io>, Bill Bejeck <bill@confluent.io>, Bruno Cadonna <bruno@confluent.io>, Boyang Chen <boyang@confluent.io>, Guozhang Wang <guozhang@confluent.io>
ijuma added a commit to confluentinc/kafka that referenced this pull request Aug 4, 2019
Merge remote-tracking branch 'apache-github/2.3' into ccs-2.3
* apache-github/2.3:
  MINOR: Avoid dividing by zero (apache#7143)
  KAFKA-8731: InMemorySessionStore throws NullPointerException on startup (apache#7132)
  KAFKA-8715; Fix buggy reliance on state timestamp in static member.id generation (apache#7116)
  KAFKA-8678; Fix leave group protocol bug in throttling and error response (apache#7101)
bellemare added a commit to bellemare/kafka that referenced this pull request Aug 8, 2019
MINOR: Avoid dividing by zero (apache#7143)
Reviews: A. Sophie Blee-Goldman <sophie@confluent.io>, Bill Bejeck <bill@confluent.io>, Bruno Cadonna <bruno@confluent.io>, Boyang Chen <boyang@confluent.io>, Guozhang Wang <guozhang@confluent.io>
jsancio pushed a commit to jsancio/kafka that referenced this pull request Aug 20, 2019
CONFLUENT: Sync from confluentinc/kafka (9 August 2019)
Stanislav adjusted AdminManager to reject dynamic logging updates
from the multi-tenant principal. Fixed a compiler error in KafkaApis
by passing the principal.

Conflicts:
* Jenkinsfile: kept the local changes and discarded the ccs-kafka ones.
* core/src/main/scala/kafka/server/AdminManager.scala: TBD
* gradle.properties: kept the local version, took the rest.
* gradle/dependencies.gradle: kept the additional dependencies defined by
ce-kafka, took the rest.

confluent/master: (23 commits)
  CONFLUENT: Build cp-downstream-builds as part of Jenkins PR Job (apache#216)
  MINOR: Ignore dynamic log4j log level tests (apache#7183)
  KAFKA-8748: Fix flaky testDescribeLogDirsRequest (apache#7182)
  KAFKA-8598: Use automatic RPC generation in RenewDelegationToken
  KAFKA-8179: Part 3, Add PartitionsLost API for resetGenerations and metadata/subscription change (apache#6884)
  MINOR: Update dependencies for Kafka 2.4 (apache#7126)
  KAFKA-8599: Use automatic RPC generation in ExpireDelegationToken
  MINOR: Upgrade jackson-databind to 2.9.9.3 (apache#7125)
  MINOR: some small style fixes to RoundRobinPartitioner
  KAFKA-8736: Streams performance improvement, use isEmpty() rather than size() == 0 (apache#7164)
  Minor: Refactor methods to add metrics to sensor in `StreamsMetricsImpl` (apache#7161)
  MINOR: Fix potential bug in LogConfig.getConfigValue and improve test coverage (apache#7159)
  KAFKA-6263; Expose metrics for group and transaction metadata loading duration
  MINOR: Avoid dividing by zero (apache#7143)
  MINOR: Fix typo in docs (apache#7158)
  MINOR: Fix binary compatibility break in KafkaClientSupplier.getAdminClient (apache#7157)
  KAFKA-7800; Dynamic log levels admin API (KIP-412)
  KAFKA-8578: Add basic functionality to expose RocksDB metrics (apache#6979)
  MINOR: Update docs to reflect the ZK 3.5.5 upgrade (apache#7149)
  KAFKA-7548; KafkaConsumer should not discard fetched data for paused partitions (apache#6988)
  ...

Co-authored-by: Stanislav Kozlovski <stanislav_kozlovski@outlook.com>
Co-authored-by: Ismael Juma <ismael@juma.me.uk>
xiowu0 added a commit to linkedin/kafka that referenced this pull request Aug 22, 2019
[LI-CHERRY-PICK] [7b52feb] MINOR: Avoid dividing by zero (apache#7143)
TICKET =
LI_DESCRIPTION =
EXIT_CRITERIA = HASH [7b52feb]
ORIGINAL_DESCRIPTION =

Reviews: A. Sophie Blee-Goldman <sophie@confluent.io>, Bill Bejeck <bill@confluent.io>, Bruno Cadonna <bruno@confluent.io>, Boyang Chen <boyang@confluent.io>, Guozhang Wang <guozhang@confluent.io>
(cherry picked from commit 7b52feb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.