From ded7f99caddec997811126ee5647514c08e8f76b Mon Sep 17 00:00:00 2001 From: Roman Leventov Date: Wed, 6 Mar 2019 19:47:46 -0300 Subject: [PATCH 1/8] Add the pull-request template --- .github/pull_request_template.md | 53 ++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000000..ebb61aca2445 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,53 @@ +Fixes #XXXX. + +(Replace XXXX with the id of the issue fixed in this PR. Remove this line if there is no corresponding +issue. Don't reference the issue in the title of this pull-request.) + +Add tags to your PR if you are a committer (only committers have the right to add tags). Add [Design Review] tag +if this PR should better be reviewed by at least two people. +Don't forget to add the following tags (if applicable): [Incompatible], [Release Notes], [Compatibility], [Security], +[Development Blocker]. Add at least one [Area - ] tag, consider creating a new one if none of the existing [Area - ] +tags is applicable. + +### Description + +Describe the goal of this PR, what problem are you fixing. If there is a corresponding issue (referenced above), it's +not necessary to repeat the description here, however, you may choose to keep one summary sentence. + +Describe your patch: what did you change in code? How did you fix the problem? + +If there are several relatively logically separate changes in this PR, list them. For example: + - Fixed the bug ... + - Renamed the class ... + - Added a forbidden-apis entry ... + +Some of the aspects mentioned above may be omitted for simple and small PRs. + +### Design + +If the change involves any design decisions, including: + - Choosing algorithm of doing something + - Choosing the Druid behaviour (Should certain configuration values be accepted? What some Druid nodes should do in + some corner situations, e. g. insufficient resources?) + - Class organization and design (how the logic is split between classes, inheritance, composition, design patterns) + - Method organization and design (how the logic is split between methods, parameters and return types) + - Naming (class, method, API, configuration, HTTP endpoint, names of emitted metrics) + +Describe alternative designs (mention alternative names) and compare them with the designs that you've implemented (the +names you've chosen). + +If you already did this in the associated issue (e. g. a "Proposal" issue), leave the following sentence: + +Design of this change is discussed [here](). + +This section may be omitted for really simple and small patches. However, any patch that adds a new production class +almost certainly shouldn't omit this section. + +
+ +I've self-reviewed this PR (including using the [concurrency checklist]( +https://medium.com/@leventov/code-review-checklist-java-concurrency-49398c326154)). + +Leave the sentence above if you've self-reviewed your PR. Leave the part in parens if your PR has any relation to Java +concurrency (any use of Threads, `synchronized`, `volatile`, `ConcurrentHashMap`, etc.) and you used the referenced +checklist during your self-review. \ No newline at end of file From dd19b433bcb31145d62235eacbb964f353b7efdb Mon Sep 17 00:00:00 2001 From: Roman Leventov Date: Thu, 7 Mar 2019 19:33:47 -0300 Subject: [PATCH 2/8] Rewording --- .github/pull_request_template.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index ebb61aca2445..64eb66d459aa 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -25,16 +25,16 @@ Some of the aspects mentioned above may be omitted for simple and small PRs. ### Design -If the change involves any design decisions, including: - - Choosing algorithm of doing something - - Choosing the Druid behaviour (Should certain configuration values be accepted? What some Druid nodes should do in - some corner situations, e. g. insufficient resources?) +Please describe any design decisions made, including: + - Choice of algorithms + - Behavioral aspects. What configuration values are acceptable? How are corner cases and error conditions handled, such + as when insufficient resources are available? - Class organization and design (how the logic is split between classes, inheritance, composition, design patterns) - Method organization and design (how the logic is split between methods, parameters and return types) - Naming (class, method, API, configuration, HTTP endpoint, names of emitted metrics) -Describe alternative designs (mention alternative names) and compare them with the designs that you've implemented (the -names you've chosen). +In addition, describe _at least one_ alternative design (or mention alternative name) for every design (or naming) +decision point and compare the alternatives with the designs that you've implemented (or the names you've chosen). If you already did this in the associated issue (e. g. a "Proposal" issue), leave the following sentence: From d5ccfb4309445cbfc823925bb1b554b1db7f1c0e Mon Sep 17 00:00:00 2001 From: Roman Leventov Date: Mon, 11 Mar 2019 12:04:22 -0300 Subject: [PATCH 3/8] Replaced checklist link, added Rat exclusion --- .github/pull_request_template.md | 2 +- pom.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 64eb66d459aa..d52977c9859a 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -46,7 +46,7 @@ almost certainly shouldn't omit this section.
I've self-reviewed this PR (including using the [concurrency checklist]( -https://medium.com/@leventov/code-review-checklist-java-concurrency-49398c326154)). +https://github.com/leventov/java-concurrency-checklist)). Leave the sentence above if you've self-reviewed your PR. Leave the part in parens if your PR has any relation to Java concurrency (any use of Threads, `synchronized`, `volatile`, `ConcurrentHashMap`, etc.) and you used the referenced diff --git a/pom.xml b/pom.xml index 9818aab5d64e..0f297a84ce78 100644 --- a/pom.xml +++ b/pom.xml @@ -1489,6 +1489,7 @@ NOTICE.BINARY LABELS.md .github/ISSUE_TEMPLATE/*.md + .github/pull_request_template.md From ad543b68cc0431dcf1b795cf840490366a5b899a Mon Sep 17 00:00:00 2001 From: Roman Leventov Date: Wed, 17 Apr 2019 16:32:52 +0200 Subject: [PATCH 4/8] Update the PR template. Add Concurrency Checklist to the repository --- .github/pull_request_template.md | 40 ++++--- dev/code-review/concurrency.md | 178 +++++++++++++++++++++++++++++++ 2 files changed, 202 insertions(+), 16 deletions(-) create mode 100644 dev/code-review/concurrency.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index d52977c9859a..9f978534b2d7 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -3,11 +3,8 @@ Fixes #XXXX. (Replace XXXX with the id of the issue fixed in this PR. Remove this line if there is no corresponding issue. Don't reference the issue in the title of this pull-request.) -Add tags to your PR if you are a committer (only committers have the right to add tags). Add [Design Review] tag -if this PR should better be reviewed by at least two people. -Don't forget to add the following tags (if applicable): [Incompatible], [Release Notes], [Compatibility], [Security], -[Development Blocker]. Add at least one [Area - ] tag, consider creating a new one if none of the existing [Area - ] -tags is applicable. +(If you are a committer, follow the PR action item checklist for committers: +https://github.com/apache/incubator-druid/blob/master/dev/committer-instructions.md#pr-and-issue-action-item-checklist-for-committers.) ### Description @@ -33,21 +30,32 @@ Please describe any design decisions made, including: - Method organization and design (how the logic is split between methods, parameters and return types) - Naming (class, method, API, configuration, HTTP endpoint, names of emitted metrics) -In addition, describe _at least one_ alternative design (or mention alternative name) for every design (or naming) -decision point and compare the alternatives with the designs that you've implemented (or the names you've chosen). +It's good to describe an alternative design (or mention an alternative name) for every design (or naming) decision point +and compare the alternatives with the designs that you've implemented (or the names you've chosen) to highlight the +advantages of the chosen designs and names. -If you already did this in the associated issue (e. g. a "Proposal" issue), leave the following sentence: - -Design of this change is discussed [here](). +If there was a discussion of the design of the feature implemented in this PR elsewhere (e. g. a "Proposal" issue, any +other issue, or a thread in the development mailing list), link to that discussion from this PR description and explain +what have changed in your final design compared to your original proposal or the consensus version in the end of the +discussion. If something hasn't changed since the original discussion, you can omit a detailed discussion of those +aspects of the design here, perhaps apart from brief mentioning for the sake of readability of this PR description. This section may be omitted for really simple and small patches. However, any patch that adds a new production class almost certainly shouldn't omit this section.
-I've self-reviewed this PR (including using the [concurrency checklist]( -https://github.com/leventov/java-concurrency-checklist)). - -Leave the sentence above if you've self-reviewed your PR. Leave the part in parens if your PR has any relation to Java -concurrency (any use of Threads, `synchronized`, `volatile`, `ConcurrentHashMap`, etc.) and you used the referenced -checklist during your self-review. \ No newline at end of file +This PR has: +- [ ] been self-reviewed. + - [ ] using the [concurrency checklist]( + https://github.com/apache/incubator-druid/blob/master/dev/code-review/concurrency.md) (Remove this item if the PR + doesn't have any relation to concurrency.) +- [ ] added documentation for new or modified features or behaviors. +- [ ] added Javadocs to non-trivial members. +- [ ] added code comments for hard to understand areas. +- [ ] added unit tests or modified existing tests to cover new code paths. +- [ ] added integration tests. +- [ ] been tested in a test environment. +- [ ] been tested in a production environment. + +(Check the items by putting "x" in the brackets for the done things. Not all of these items apply to every PR.) \ No newline at end of file diff --git a/dev/code-review/concurrency.md b/dev/code-review/concurrency.md new file mode 100644 index 000000000000..6976abdfd36f --- /dev/null +++ b/dev/code-review/concurrency.md @@ -0,0 +1,178 @@ +## Druid's Checklist for Concurrency Code + +Design + - [Concurrency is rationalized in the PR description?]( + https://github.com/code-review-checklists/java-concurrency#rationalize) + - [Can use patterns to simplify concurrency?](https://github.com/code-review-checklists/java-concurrency#use-patterns) + - Immutability/Snapshotting + - Divide and conquer + - Producer-consumer + - Instance confinement + - Thread/Task/Serial thread confinement + +Documentation + - [Thread-safety is justified in comments?]( + https://github.com/code-review-checklists/java-concurrency#justify-document) + - [Class (method, field) has concurrent access documentation?]( + https://github.com/code-review-checklists/java-concurrency#justify-document) + - [Threading model of a subsystem (class) is described?]( + https://github.com/code-review-checklists/java-concurrency#threading-flow-model) + - [Concurrent control flow (or data flow) of a subsystem (class) is described?]( + https://github.com/code-review-checklists/java-concurrency#threading-flow-model) + - [Class is documented as immutable, thread-safe, or not thread-safe?]( + https://github.com/code-review-checklists/java-concurrency#immutable-thread-safe) + - [Applied concurrency patterns are pronounced?]( + https://github.com/code-review-checklists/java-concurrency#name-patterns) + - [`@GuardedBy` annotation is used?](https://github.com/code-review-checklists/java-concurrency#guarded-by) + - [Safety of benign races is explained?]( + https://github.com/code-review-checklists/java-concurrency#document-benign-race) + - [Each use of `volatile` is justified?]( + https://github.com/code-review-checklists/java-concurrency#justify-volatile) + - [Field that is neither `volatile` nor annotated with `@GuardedBy` has a comment?]( + https://github.com/code-review-checklists/java-concurrency#plain-field) + +Excessive thread safety + - [No "extra" (pseudo) thread safety?](https://github.com/code-review-checklists/java-concurrency#pseudo-safety) + - [No atomics on which only `get()` and `set()` are called?]( + https://github.com/code-review-checklists/java-concurrency#redundant-atomics) + - [Class (method) needs to be thread-safe?]( + https://github.com/code-review-checklists/java-concurrency#unneeded-thread-safety) + +Race conditions + - [No `put()` or `remove()` calls on a `ConcurrentHashMap` after `get()` or `containsKey()`?]( + https://github.com/code-review-checklists/java-concurrency#chm-race) + - [No point accesses to a non-thread-safe collection outside of critical sections?]( + https://github.com/code-review-checklists/java-concurrency#unsafe-concurrent-point-read) + - [Iteration over a non-thread-safe collection doesn't leak outside of a critical section?]( + https://github.com/code-review-checklists/java-concurrency#unsafe-concurrent-iteration) + - [Non-trivial object is *not* returned from a getter in a thread-safe class?]( + https://github.com/code-review-checklists/java-concurrency#concurrent-mutation-race) + - [No separate getters to an atomically updated state?]( + https://github.com/code-review-checklists/java-concurrency#moving-state-race) + - [No state used for making decisions or preparing data inside a critical section is read outside?]( + https://github.com/code-review-checklists/java-concurrency#read-outside-critical-section-race) + - [No race conditions are possible between the program and users or other programs?]( + https://github.com/code-review-checklists/java-concurrency#outside-world-race) + - [No race conditions are possible on the file system?]( + https://github.com/code-review-checklists/java-concurrency#outside-world-race) + +Replacing locks with concurrency utilities + - [Can use `LifecycleLock` instead of a standard lock in a lifecycled object?](#use-lifecycle-lock) + - [Can use concurrency utility instead of `Object.wait()`/`notify()`?]( + https://github.com/code-review-checklists/java-concurrency#avoid-wait-notify) + - [Can use Guava’s `Monitor` instead of a standard lock with conditional waits?]( + https://github.com/code-review-checklists/java-concurrency#guava-monitor) + +Avoiding deadlocks + - [Can avoid nested critical sections?]( + https://github.com/code-review-checklists/java-concurrency#avoid-nested-critical-sections) + - [Locking order for nested critical sections is documented?]( + https://github.com/code-review-checklists/java-concurrency#document-locking-order) + - [Dynamically determined locks for nested critical sections are ordered?]( + https://github.com/code-review-checklists/java-concurrency#dynamic-lock-ordering) + - [No extension API calls within critical sections?]( + https://github.com/code-review-checklists/java-concurrency#non-open-call) + +Improving scalability + - [Critical section is as small as possible?]( + https://github.com/code-review-checklists/java-concurrency#minimize-critical-sections) + - [Can use `ConcurrentHashMap.compute()` or Guava's `Striped` for per-key locking?]( + https://github.com/code-review-checklists/java-concurrency#increase-locking-granularity) + - [Can replace blocking collection or a queue with a concurrent one?]( + https://github.com/code-review-checklists/java-concurrency#non-blocking-collections) + - [Can use `ClassValue` instead of `ConcurrentHashMap`?]( + https://github.com/code-review-checklists/java-concurrency#use-class-value) + - [Considered `ReadWriteLock` (or `StampedLock`) instead of a simple lock?]( + https://github.com/code-review-checklists/java-concurrency#read-write-lock) + - [`StampedLock` is used instead of `ReadWriteLock` when reentrancy is not needed?]( + https://github.com/code-review-checklists/java-concurrency#use-stamped-lock) + - [Considered `LongAdder` instead of an `AtomicLong` for a "hot field"?]( + https://github.com/code-review-checklists/java-concurrency#long-adder-for-hot-fields) + +Lazy initialization and double-checked locking + - [Lazy initialization of a field should be thread-safe?]( + https://github.com/code-review-checklists/java-concurrency#lazy-init-thread-safety) + - [Considered double-checked locking for a lazy initialization to improve performance?]( + https://github.com/code-review-checklists/java-concurrency#use-dcl) + - [Considered eager initialization instead of a lazy initialization to simplify code?]( + https://github.com/code-review-checklists/java-concurrency#eager-init) + - [Double-checked locking follows the SafeLocalDCL pattern?]( + https://github.com/code-review-checklists/java-concurrency#safe-local-dcl) + - [Can do lazy initialization with a benign race and without locking to improve performance?]( + https://github.com/code-review-checklists/java-concurrency#lazy-init-benign-race) + +Non-blocking and partially blocking code + - [Non-blocking code has enough comments to make line-by-line checking as easy as possible?]( + https://github.com/code-review-checklists/java-concurrency#check-non-blocking-code) + - [Can use immutable POJO + compare-and-swap operations to simplify non-blocking code?]( + https://github.com/code-review-checklists/java-concurrency#swap-state-atomically) + +Threads and Executors + - [Thread is named?](https://github.com/code-review-checklists/java-concurrency#name-threads) + - [Thread is daemon?](#daemon-threads) + - [Using `Execs` to create an `ExecutorService`?](#use-execs) + - [Can use `ExecutorService` instead of creating a new `Thread` each time some method is called?]( + https://github.com/code-review-checklists/java-concurrency#reuse-threads) + - [No network I/O in a CachedThreadPool?]( + https://github.com/code-review-checklists/java-concurrency#cached-thread-pool-no-io) + - [No blocking (incl. I/O) operations in a `ForkJoinPool` or in a parallel Stream pipeline? + ](https://github.com/code-review-checklists/java-concurrency#fjp-no-blocking) + - [Can execute non-blocking computation in `FJP.commonPool()` instead of a custom thread pool?]( + https://github.com/code-review-checklists/java-concurrency#use-common-fjp) + +Parallel Streams + - [Parallel Stream computation takes more than 100us in total?]( + https://github.com/code-review-checklists/java-concurrency#justify-parallel-stream-use) + - [Comment before a parallel Streams pipeline explains how it takes more than 100us in total?]( + https://github.com/code-review-checklists/java-concurrency#justify-parallel-stream-use) + +Thread interruption and `Future` cancellation + - [Interruption status is restored before propagating a wrapped `InterruptedException`? + ](https://github.com/code-review-checklists/java-concurrency#restore-interruption) + - [`InterruptedException` is swallowed only in the following kinds of methods? + ](https://github.com/code-review-checklists/java-concurrency#interruption-swallowing) + - `Runnable.run()`, `Callable.call()`, or methods to be passed to executors as lambda tasks + - Methods with "try" or "best effort" semantics + - [`InterruptedException` swallowing is documented for a method?]( + https://github.com/code-review-checklists/java-concurrency#interruption-swallowing) + - [Can use Guava's `Uninterruptibles` to avoid `InterruptedException` swallowing?]( + https://github.com/code-review-checklists/java-concurrency#interruption-swallowing) + - [`Future` is canceled upon catching an `InterruptedException` or a `TimeoutException` on `get()`?]( + https://github.com/code-review-checklists/java-concurrency#cancel-future) + +Time + - [`nanoTime()` values are compared in an overflow-aware manner?]( + https://github.com/code-review-checklists/java-concurrency#nano-time-overflow) + - [`currentTimeMillis()` is *not* used to measure time intervals and timeouts?]( + https://github.com/code-review-checklists/java-concurrency#time-going-backward) + - [Units for a time variable are identified in the variable's name or via `TimeUnit`?]( + https://github.com/code-review-checklists/java-concurrency#time-units) + - [Negative timeouts and delays are treated as zeros?]( + https://github.com/code-review-checklists/java-concurrency#treat-negative-timeout-as-zero) + +Thread safety of Cleaners and native code + - [`close()` is concurrently idempotent in a class with a `Cleaner` or `finalize()`?]( + https://github.com/code-review-checklists/java-concurrency#thread-safe-close-with-cleaner) + - [Method accessing native state calls `reachabilityFence()` in a class with a `Cleaner` or `finalize()`?]( + https://github.com/code-review-checklists/java-concurrency#reachability-fence) + - [`Cleaner` or `finalize()` is used for real cleanup, not mere reporting?]( + https://github.com/code-review-checklists/java-concurrency#finalize-misuse) + - [Considered making a class with native state thread-safe?]( + https://github.com/code-review-checklists/java-concurrency#thread-safe-native) + +
+ + +[#](#use-lifecycle-lock) Lk.D1. Is it possible to use Druid's `LifecycleLock` utility instead of a standard lock and +"started" flag in lifecycled objects with `start()` and `stop()` methods? See the Javadoc comment for `LifecycleLock` +for more details. + + +[#](#daemon-threads) TE.D1. Are Threads created directly or via a `ThreadFactory` configured to be daemon via +`setDaemon(true)`? Note that by default, ThreadFactories constructed via `Execs.makeThreadFactory()` methods create +daemon threads already. + + +[#](#use-execs) TE.D2. Is it possible to use one of the static factory methods in Druid's `Execs` utility class to +create an `ExecutorService` instead of Java's standard `ExecutorServices`? This is recommended because `Execs` configure +ThreadFactories to create daemon threads by default, as required by the previous item. \ No newline at end of file From c9392f11c9779a4a98a6375c53a6cd719d5c6651 Mon Sep 17 00:00:00 2001 From: Roman Leventov Date: Tue, 14 May 2019 15:09:08 +0200 Subject: [PATCH 5/8] Merge Description and Design sections. Softer language. Removed requirement to test in production environment. Added a committer's instruction to justify addition of meta tags. --- .github/pull_request_template.md | 38 ++++++++++++++++++-------------- dev/committer-instructions.md | 11 +++++---- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 9f978534b2d7..378aed038dc4 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,6 +1,6 @@ Fixes #XXXX. -(Replace XXXX with the id of the issue fixed in this PR. Remove this line if there is no corresponding +(Replace XXXX with the id of the issue fixed in this PR. Remove the above line if there is no corresponding issue. Don't reference the issue in the title of this pull-request.) (If you are a committer, follow the PR action item checklist for committers: @@ -13,16 +13,13 @@ not necessary to repeat the description here, however, you may choose to keep on Describe your patch: what did you change in code? How did you fix the problem? -If there are several relatively logically separate changes in this PR, list them. For example: - - Fixed the bug ... - - Renamed the class ... - - Added a forbidden-apis entry ... +If there are several relatively logically separate changes in this PR, create a mini-section for each of them. For +example: +#### Fixed the bug ... +#### Renamed the class ... +#### Added a forbidden-apis entry ... -Some of the aspects mentioned above may be omitted for simple and small PRs. - -### Design - -Please describe any design decisions made, including: +In each section, please describe design decisions made, including: - Choice of algorithms - Behavioral aspects. What configuration values are acceptable? How are corner cases and error conditions handled, such as when insufficient resources are available? @@ -40,8 +37,7 @@ what have changed in your final design compared to your original proposal or the discussion. If something hasn't changed since the original discussion, you can omit a detailed discussion of those aspects of the design here, perhaps apart from brief mentioning for the sake of readability of this PR description. -This section may be omitted for really simple and small patches. However, any patch that adds a new production class -almost certainly shouldn't omit this section. +Some of the aspects mentioned above may be omitted for simple and small changes.
@@ -51,11 +47,19 @@ This PR has: https://github.com/apache/incubator-druid/blob/master/dev/code-review/concurrency.md) (Remove this item if the PR doesn't have any relation to concurrency.) - [ ] added documentation for new or modified features or behaviors. -- [ ] added Javadocs to non-trivial members. -- [ ] added code comments for hard to understand areas. +- [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links. +- [ ] added enough comments to make the code fully understandable in a single read-through for anybody who is not +familiar with it. - [ ] added unit tests or modified existing tests to cover new code paths. - [ ] added integration tests. -- [ ] been tested in a test environment. -- [ ] been tested in a production environment. +- [ ] been tested in a test Druid cluster. + +Check the items by putting "x" in the brackets for the done things. Not all of these items apply to every PR. Remove the +items which are not done or not relevant to the PR. None of the items from the checklist above are strictly necessary, +but it would be very helpful if you at least self-review the PR. + +
+ +For reviewers: the key changed/added classes in this PR are `MyFoo`, `OurBar`, and `TheirBaz`. -(Check the items by putting "x" in the brackets for the done things. Not all of these items apply to every PR.) \ No newline at end of file +(Add this section in big PRs to ease navigation in them for reviewers.) \ No newline at end of file diff --git a/dev/committer-instructions.md b/dev/committer-instructions.md index d23e23f7cbe4..069188e65c6a 100644 --- a/dev/committer-instructions.md +++ b/dev/committer-instructions.md @@ -87,7 +87,10 @@ committer who visits an issue or a PR authored by a non-committer. that need to be merged before some other PRs could even be published. `Development Blocker` PRs should be prioritized by reviewers, so that they could be merged as soon as possible, thus not blocking somebody's work. -2. Consider adding one or several **`Area -`** tags to the PR or issue. Consider [creating a new `Area -` tag]( +2. If you added some tags on the previous step, describe why did you do that, either in the PR description (if you are +the author of the PR) or in a comment (if you have added tags to a PR submitted by someone else). + +3. Consider adding one or several **`Area -`** tags to the PR or issue. Consider [creating a new `Area -` tag]( #creating-a-new-tag-on-github) if none of the existing `Area` tags is applicable to the PR or issue. - [`Area - Automation/Static Analysis`]( @@ -131,15 +134,15 @@ committer who visits an issue or a PR authored by a non-committer. any PRs and issues related to ZooKeeper, Curator, and node discovery in Druid. -3. **Consider adding any `Bug` and `Security` PRs to the next Druid milestone** whenever they are important enough to +4. **Consider adding any `Bug` and `Security` PRs to the next Druid milestone** whenever they are important enough to fix before the next release. This ensures that they will be considered by the next release manager as potential release blockers. Please don't add PRs that are neither `Bug` nor `Security`-related to milestones until after they are committed, to avoid cluttering the release manager's workflow. -4. If the PR has obvious problems, such as an empty description or the PR fails the CI, ask the PR author to fix these +5. If the PR has obvious problems, such as an empty description or the PR fails the CI, ask the PR author to fix these problems even if you don't plan to review the PR. -5. If you create an issue that is relatively small and self-contained and you don't plan to work on it in the near +6. If you create an issue that is relatively small and self-contained and you don't plan to work on it in the near future, consider tagging it [**`Contributions Welcome`**]( https://github.com/apache/incubator-druid/labels/Contributions%20Welcome) so that other people know that the issue is free to pick up and is relatively easily doable even for those who are not very familiar with the codebase. From 5361a8a6093ba82a875418747b521768007a570f Mon Sep 17 00:00:00 2001 From: Roman Leventov Date: Tue, 14 May 2019 15:23:01 +0200 Subject: [PATCH 6/8] Rephrase item about comments --- .github/pull_request_template.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 378aed038dc4..6715b42163de 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -48,8 +48,8 @@ This PR has: doesn't have any relation to concurrency.) - [ ] added documentation for new or modified features or behaviors. - [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links. -- [ ] added enough comments to make the code fully understandable in a single read-through for anybody who is not -familiar with it. +- [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar +reader. - [ ] added unit tests or modified existing tests to cover new code paths. - [ ] added integration tests. - [ ] been tested in a test Druid cluster. From 06e6757551c77e90d61f77f285b79f604d274b8a Mon Sep 17 00:00:00 2001 From: Roman Leventov Date: Tue, 28 May 2019 14:04:39 +0200 Subject: [PATCH 7/8] Add license header --- dev/code-review/concurrency.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dev/code-review/concurrency.md b/dev/code-review/concurrency.md index 6976abdfd36f..ccec8a1aff3b 100644 --- a/dev/code-review/concurrency.md +++ b/dev/code-review/concurrency.md @@ -1,3 +1,22 @@ + + ## Druid's Checklist for Concurrency Code Design From 25f05ad1289b4fee4a6f0a6c4ee4532c6834758c Mon Sep 17 00:00:00 2001 From: Roman Leventov Date: Fri, 21 Jun 2019 12:54:57 +0300 Subject: [PATCH 8/8] Add item to concurrency checklist --- dev/code-review/concurrency.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dev/code-review/concurrency.md b/dev/code-review/concurrency.md index ccec8a1aff3b..279d463ff313 100644 --- a/dev/code-review/concurrency.md +++ b/dev/code-review/concurrency.md @@ -125,6 +125,8 @@ Non-blocking and partially blocking code https://github.com/code-review-checklists/java-concurrency#check-non-blocking-code) - [Can use immutable POJO + compare-and-swap operations to simplify non-blocking code?]( https://github.com/code-review-checklists/java-concurrency#swap-state-atomically) + - [Boundaries of non-blocking or benignly racy code are identified by WARNING comments?]( + https://github.com/code-review-checklists/java-concurrency#non-blocking-warning) Threads and Executors - [Thread is named?](https://github.com/code-review-checklists/java-concurrency#name-threads)