Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
10289: Ensure retries are not interleaved even on multiple sequential calls r=npepinpe a=npepinpe

## Description

By using `ActorControl#submit` in some of the retry strategies, we can create race conditions if the retry strategy is reused. Since the initial call uses run to prepend a retry attempt, and further retries use submit, it's possible for one run to retry (thus submitting the retry job to the end of the queue) and the next call to `runWithRetry` cause its state to be overwritten, causing issues when it comes to completing the future (as well as potential shared state by the operations).

Additionally, this PR fixes an issue where on retry, we were not resetting the writer, causing the same command to be written multiple times.

There is a regression test added which isn't perfect, and I'd like some suggestions on how to improve it. The integration test added to the `ProcessingScheduleServiceTest` is not amazing and likely to flaky, as it's hard to write controlled tests with our timers. Suggestions are welcomed 👍 

## Related issues

closes #10240 



10324: deps(maven): bump software.amazon.awssdk:bom from 2.17.269 to 2.17.271 r=npepinpe a=dependabot[bot]

Bumps [software.amazon.awssdk:bom](https://github.com/aws/aws-sdk-java-v2) from 2.17.269 to 2.17.271.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/aws/aws-sdk-java-v2/blob/master/CHANGELOG.md">software.amazon.awssdk:bom's changelog</a>.</em></p>
<blockquote>
<h1><strong>2.17.271</strong> <strong>2022-09-09</strong></h1>
<h2><strong>AWS CloudTrail</strong></h2>
<ul>
<li>
<h3>Features</h3>
<ul>
<li>This release adds CloudTrail getChannel and listChannels APIs to allow customer to view the ServiceLinkedChannel configurations.</li>
</ul>
</li>
</ul>
<h2><strong>AWS Performance Insights</strong></h2>
<ul>
<li>
<h3>Features</h3>
<ul>
<li>Increases the maximum values of two RDS Performance Insights APIs. The maximum value of the Limit parameter of DimensionGroup is 25. The MaxResult maximum is now 25 for the following APIs: DescribeDimensionKeys, GetResourceMetrics, ListAvailableResourceDimensions, and ListAvailableResourceMetrics.</li>
</ul>
</li>
</ul>
<h2><strong>AWS SDK for Java v2</strong></h2>
<ul>
<li>
<h3>Features</h3>
<ul>
<li>Updated service endpoint metadata.</li>
</ul>
</li>
</ul>
<h2><strong>Amazon Lex Model Building V2</strong></h2>
<ul>
<li>
<h3>Features</h3>
<ul>
<li>This release is for supporting Composite Slot Type feature in AWS Lex V2. Composite Slot Type will help developer to logically group coherent slots and maintain their inter-relationships in runtime conversation.</li>
</ul>
</li>
</ul>
<h2><strong>Amazon Lex Runtime V2</strong></h2>
<ul>
<li>
<h3>Features</h3>
<ul>
<li>This release is for supporting Composite Slot Type feature in AWS Lex V2. Composite Slot Type will help developer to logically group coherent slots and maintain their inter-relationships in runtime conversation.</li>
</ul>
</li>
</ul>
<h2><strong>Amazon Redshift</strong></h2>
<ul>
<li>
<h3>Features</h3>
<ul>
<li>This release updates documentation for AQUA features and other description updates.</li>
</ul>
</li>
</ul>
<h1><strong>2.17.270</strong> <strong>2022-09-08</strong></h1>
<h2><strong>AWS Common Runtime HTTP Client</strong></h2>
<ul>
<li>
<h3>Features</h3>
<ul>
<li>Adds support for Https proxy system properties: host, port, user, password</li>
</ul>
</li>
</ul>
<h2><strong>AWS Elemental MediaLive</strong></h2>
<ul>
<li>
<h3>Features</h3>
<ul>
<li>This change exposes API settings which allow Dolby Atmos and Dolby Vision to be used when running a channel using Elemental Media Live</li>
</ul>
</li>
</ul>
<h2><strong>AWS SDK for Java v2</strong></h2>
<ul>
<li>
<h3>Features</h3>
<ul>
<li>Updated service endpoint metadata.</li>
</ul>
</li>
</ul>
<h2><strong>Amazon EMR Containers</strong></h2>
<ul>
<li>
<h3>Features</h3>
<ul>
<li>EMR on EKS now allows running Spark SQL using the newly introduced Spark SQL Job Driver in the Start Job Run API</li>
</ul>
</li>
</ul>
<h2><strong>Amazon Elastic Compute Cloud</strong></h2>
<ul>
<li>
<h3>Features</h3>
<ul>
<li>This release adds support to send VPC Flow Logs to kinesis-data-firehose as new destination type</li>
</ul>
</li>
</ul>
<h2><strong>Amazon Lookout for Metrics</strong></h2>
<ul>
<li>
<h3>Features</h3>
<ul>
<li>Release dimension value filtering feature to allow customers to define dimension filters for including only a subset of their dataset to be used by LookoutMetrics.</li>
</ul>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/aws/aws-sdk-java-v2/commit/0c8422ebc6449e1e691656d7291da77d6011649d"><code>0c8422e</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/aws/aws-sdk-java-v2/issues/2142">#2142</a> from aws/staging/bea6ab8b-b330-4cc1-8ca8-94bfb1689861</li>
<li><a href="https://github.com/aws/aws-sdk-java-v2/commit/0f4f98929600e72eb967627794e35e96771e2afe"><code>0f4f989</code></a> Release 2.17.271. Updated CHANGELOG.md, README.md and all pom.xml.</li>
<li><a href="https://github.com/aws/aws-sdk-java-v2/commit/8d63789be9dfd364fefd00b5854f06c485e2b180"><code>8d63789</code></a> Updated endpoints.json.</li>
<li><a href="https://github.com/aws/aws-sdk-java-v2/commit/6351b993b38a7d07ce10173aa5aaac81ca2ea975"><code>6351b99</code></a> Amazon Lex Model Building V2 Update: This release is for supporting Composite...</li>
<li><a href="https://github.com/aws/aws-sdk-java-v2/commit/583f5018daa6c105350297b3c071bcbe76e2e940"><code>583f501</code></a> Amazon Redshift Update: This release updates documentation for AQUA features ...</li>
<li><a href="https://github.com/aws/aws-sdk-java-v2/commit/3404db0de6a9f1dba7f021f6d23850f17d61b284"><code>3404db0</code></a> AWS Performance Insights Update: Increases the maximum values of two RDS Perf...</li>
<li><a href="https://github.com/aws/aws-sdk-java-v2/commit/7ae99600853441be20fd3a1ebce4c62f197c66aa"><code>7ae9960</code></a> AWS CloudTrail Update: This release adds CloudTrail getChannel and listChanne...</li>
<li><a href="https://github.com/aws/aws-sdk-java-v2/commit/b0edee8185b2a07916326fc6c32eef02ad1698c5"><code>b0edee8</code></a> Amazon Lex Runtime V2 Update: This release is for supporting Composite Slot T...</li>
<li><a href="https://github.com/aws/aws-sdk-java-v2/commit/e377518b08ccc2cd9cc32be74345064b2fadee64"><code>e377518</code></a> Update LaunchChangelog.md (<a href="https://github-redirect.dependabot.com/aws/aws-sdk-java-v2/issues/3417">#3417</a>)</li>
<li><a href="https://github.com/aws/aws-sdk-java-v2/commit/3e1f08ad9562e3203f904fe6f51f7fb1d2878953"><code>3e1f08a</code></a> Update to next snapshot version: 2.17.271-SNAPSHOT</li>
<li>Additional commits viewable in <a href="https://github.com/aws/aws-sdk-java-v2/compare/2.17.269...2.17.271">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=software.amazon.awssdk:bom&package-manager=maven&previous-version=2.17.269&new-version=2.17.271)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting ``@dependabot` rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- ``@dependabot` rebase` will rebase this PR
- ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it
- ``@dependabot` merge` will merge this PR after your CI passes on it
- ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it
- ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging
- ``@dependabot` reopen` will reopen this PR if it is closed
- ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

10325: deps(maven): bump version.micrometer from 1.9.3 to 1.9.4 r=npepinpe a=dependabot[bot]

Bumps `version.micrometer` from 1.9.3 to 1.9.4.
Updates `micrometer-core` from 1.9.3 to 1.9.4
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/micrometer-metrics/micrometer/releases">micrometer-core's releases</a>.</em></p>
<blockquote>
<h2>1.9.4</h2>
<h2>:star: New Features</h2>
<ul>
<li>HTTP server instrumentation TCK <a href="https://github-redirect.dependabot.com/micrometer-metrics/micrometer/pull/3379">#3379</a></li>
</ul>
<h2>:lady_beetle: Bug Fixes</h2>
<ul>
<li>system.cpu.usage missing with OpenJ9 0.33.0 <a href="https://github-redirect.dependabot.com/micrometer-metrics/micrometer/issues/3349">#3349</a></li>
<li>Uri tag replaced with REDIRECTION on all HTTP redirect responses with Jersey server <a href="https://github-redirect.dependabot.com/micrometer-metrics/micrometer/issues/3327">#3327</a></li>
</ul>
<h2>:hammer: Dependency Upgrades</h2>
<ul>
<li>Upgrade to signalfx-java 1.0.23 <a href="https://github-redirect.dependabot.com/micrometer-metrics/micrometer/issues/3407">#3407</a></li>
<li>Upgrade to aws-java-sdk-cloudwatch 1.12.300 and software.amazon.awssdk:cloudwatch 2.17.271 <a href="https://github-redirect.dependabot.com/micrometer-metrics/micrometer/issues/3406">#3406</a></li>
<li>Upgrade to Reactor 2020.0.22 and netty 4.1.81 <a href="https://github-redirect.dependabot.com/micrometer-metrics/micrometer/issues/3405">#3405</a></li>
<li>Upgrade to Test Retry Gradle Plugin 1.4.1 <a href="https://github-redirect.dependabot.com/micrometer-metrics/micrometer/pull/3380">#3380</a></li>
<li>Bump com.gradle.enterprise from 3.10.3 to 3.11.1 <a href="https://github-redirect.dependabot.com/micrometer-metrics/micrometer/pull/3353">#3353</a></li>
</ul>
<h2>:heart: Contributors</h2>
<p>We'd like to thank all the contributors who worked on this release!</p>
<ul>
<li><a href="https://github.com/izeye"><code>`@​izeye</code></a></li>`
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/micrometer-metrics/micrometer/commit/aa5be1ef19281aa83df19d4242803e5e2206640c"><code>aa5be1e</code></a> Remove conditional check for disabling japicmp in otlp</li>
<li><a href="https://github.com/micrometer-metrics/micrometer/commit/134dca6c09d3fba691c68ccd0d3fb9a4ca6cea2a"><code>134dca6</code></a> Merge branch '1.8.x' into 1.9.x</li>
<li><a href="https://github.com/micrometer-metrics/micrometer/commit/bd470ce080153c474fde9fb5d559bcdc56589f48"><code>bd470ce</code></a> HTTP server instrumentation TCK (<a href="https://github-redirect.dependabot.com/micrometer-metrics/micrometer/issues/3379">#3379</a>)</li>
<li><a href="https://github.com/micrometer-metrics/micrometer/commit/277c8dd1acac0a91010505ca194c7514bf304395"><code>277c8dd</code></a> Merge branch '1.8.x' into 1.9.x</li>
<li><a href="https://github.com/micrometer-metrics/micrometer/commit/f89e67c83db62f436d48e69db82ce61c0c527e9c"><code>f89e67c</code></a> Upgrade to signalfx-java 1.0.23</li>
<li><a href="https://github.com/micrometer-metrics/micrometer/commit/60412c4b838e96ae2c7b2e4dd35b323fcb9ce508"><code>60412c4</code></a> Upgrade to aws-java-sdk-cloudwatch 1.12.300 and software.amazon.awssdk:cloudw...</li>
<li><a href="https://github.com/micrometer-metrics/micrometer/commit/c18a194c4292d3e79206f89ac519dbcad5e33db8"><code>c18a194</code></a> Upgrade to Reactor 2020.0.22 and netty 4.1.81</li>
<li><a href="https://github.com/micrometer-metrics/micrometer/commit/20c423caf98fef3763af88df2811026a2d8dd92a"><code>20c423c</code></a> Enable Gradle's stable configuration cache feature flag (<a href="https://github-redirect.dependabot.com/micrometer-metrics/micrometer/issues/3390">#3390</a>)</li>
<li><a href="https://github.com/micrometer-metrics/micrometer/commit/2a497ab93539101abd5499c841fed5b7891ac86b"><code>2a497ab</code></a> japicmp for 1.9.x branch</li>
<li><a href="https://github.com/micrometer-metrics/micrometer/commit/71bad060f23170259ece454304a5b9b8448372a9"><code>71bad06</code></a> Merge branch '1.8.x' into 1.9.x</li>
<li>Additional commits viewable in <a href="https://github.com/micrometer-metrics/micrometer/compare/v1.9.3...v1.9.4">compare view</a></li>
</ul>
</details>
<br />

Updates `micrometer-registry-prometheus` from 1.9.3 to 1.9.4
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/micrometer-metrics/micrometer/releases">micrometer-registry-prometheus's releases</a>.</em></p>
<blockquote>
<h2>1.9.4</h2>
<h2>:star: New Features</h2>
<ul>
<li>HTTP server instrumentation TCK <a href="https://github-redirect.dependabot.com/micrometer-metrics/micrometer/pull/3379">#3379</a></li>
</ul>
<h2>:lady_beetle: Bug Fixes</h2>
<ul>
<li>system.cpu.usage missing with OpenJ9 0.33.0 <a href="https://github-redirect.dependabot.com/micrometer-metrics/micrometer/issues/3349">#3349</a></li>
<li>Uri tag replaced with REDIRECTION on all HTTP redirect responses with Jersey server <a href="https://github-redirect.dependabot.com/micrometer-metrics/micrometer/issues/3327">#3327</a></li>
</ul>
<h2>:hammer: Dependency Upgrades</h2>
<ul>
<li>Upgrade to signalfx-java 1.0.23 <a href="https://github-redirect.dependabot.com/micrometer-metrics/micrometer/issues/3407">#3407</a></li>
<li>Upgrade to aws-java-sdk-cloudwatch 1.12.300 and software.amazon.awssdk:cloudwatch 2.17.271 <a href="https://github-redirect.dependabot.com/micrometer-metrics/micrometer/issues/3406">#3406</a></li>
<li>Upgrade to Reactor 2020.0.22 and netty 4.1.81 <a href="https://github-redirect.dependabot.com/micrometer-metrics/micrometer/issues/3405">#3405</a></li>
<li>Upgrade to Test Retry Gradle Plugin 1.4.1 <a href="https://github-redirect.dependabot.com/micrometer-metrics/micrometer/pull/3380">#3380</a></li>
<li>Bump com.gradle.enterprise from 3.10.3 to 3.11.1 <a href="https://github-redirect.dependabot.com/micrometer-metrics/micrometer/pull/3353">#3353</a></li>
</ul>
<h2>:heart: Contributors</h2>
<p>We'd like to thank all the contributors who worked on this release!</p>
<ul>
<li><a href="https://github.com/izeye"><code>`@​izeye</code></a></li>`
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/micrometer-metrics/micrometer/commit/aa5be1ef19281aa83df19d4242803e5e2206640c"><code>aa5be1e</code></a> Remove conditional check for disabling japicmp in otlp</li>
<li><a href="https://github.com/micrometer-metrics/micrometer/commit/134dca6c09d3fba691c68ccd0d3fb9a4ca6cea2a"><code>134dca6</code></a> Merge branch '1.8.x' into 1.9.x</li>
<li><a href="https://github.com/micrometer-metrics/micrometer/commit/bd470ce080153c474fde9fb5d559bcdc56589f48"><code>bd470ce</code></a> HTTP server instrumentation TCK (<a href="https://github-redirect.dependabot.com/micrometer-metrics/micrometer/issues/3379">#3379</a>)</li>
<li><a href="https://github.com/micrometer-metrics/micrometer/commit/277c8dd1acac0a91010505ca194c7514bf304395"><code>277c8dd</code></a> Merge branch '1.8.x' into 1.9.x</li>
<li><a href="https://github.com/micrometer-metrics/micrometer/commit/f89e67c83db62f436d48e69db82ce61c0c527e9c"><code>f89e67c</code></a> Upgrade to signalfx-java 1.0.23</li>
<li><a href="https://github.com/micrometer-metrics/micrometer/commit/60412c4b838e96ae2c7b2e4dd35b323fcb9ce508"><code>60412c4</code></a> Upgrade to aws-java-sdk-cloudwatch 1.12.300 and software.amazon.awssdk:cloudw...</li>
<li><a href="https://github.com/micrometer-metrics/micrometer/commit/c18a194c4292d3e79206f89ac519dbcad5e33db8"><code>c18a194</code></a> Upgrade to Reactor 2020.0.22 and netty 4.1.81</li>
<li><a href="https://github.com/micrometer-metrics/micrometer/commit/20c423caf98fef3763af88df2811026a2d8dd92a"><code>20c423c</code></a> Enable Gradle's stable configuration cache feature flag (<a href="https://github-redirect.dependabot.com/micrometer-metrics/micrometer/issues/3390">#3390</a>)</li>
<li><a href="https://github.com/micrometer-metrics/micrometer/commit/2a497ab93539101abd5499c841fed5b7891ac86b"><code>2a497ab</code></a> japicmp for 1.9.x branch</li>
<li><a href="https://github.com/micrometer-metrics/micrometer/commit/71bad060f23170259ece454304a5b9b8448372a9"><code>71bad06</code></a> Merge branch '1.8.x' into 1.9.x</li>
<li>Additional commits viewable in <a href="https://github.com/micrometer-metrics/micrometer/compare/v1.9.3...v1.9.4">compare view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting ``@dependabot` rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- ``@dependabot` rebase` will rebase this PR
- ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it
- ``@dependabot` merge` will merge this PR after your CI passes on it
- ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it
- ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging
- ``@dependabot` reopen` will reopen this PR if it is closed
- ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

10326: deps(maven): bump aws-java-sdk-core from 1.12.298 to 1.12.300 r=npepinpe a=dependabot[bot]

Bumps [aws-java-sdk-core](https://github.com/aws/aws-sdk-java) from 1.12.298 to 1.12.300.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/aws/aws-sdk-java/blob/master/CHANGELOG.md">aws-java-sdk-core's changelog</a>.</em></p>
<blockquote>
<h1><strong>1.12.300</strong> <strong>2022-09-09</strong></h1>
<h2><strong>AWS CloudTrail</strong></h2>
<ul>
<li>
<h3>Features</h3>
<ul>
<li>This release adds CloudTrail getChannel and listChannels APIs to allow customer to view the ServiceLinkedChannel configurations.</li>
</ul>
</li>
</ul>
<h2><strong>AWS Performance Insights</strong></h2>
<ul>
<li>
<h3>Features</h3>
<ul>
<li>Increases the maximum values of two RDS Performance Insights APIs. The maximum value of the Limit parameter of DimensionGroup is 25. The MaxResult maximum is now 25 for the following APIs: DescribeDimensionKeys, GetResourceMetrics, ListAvailableResourceDimensions, and ListAvailableResourceMetrics.</li>
</ul>
</li>
</ul>
<h2><strong>Amazon Lex Model Building V2</strong></h2>
<ul>
<li>
<h3>Features</h3>
<ul>
<li>This release is for supporting Composite Slot Type feature in AWS Lex V2. Composite Slot Type will help developer to logically group coherent slots and maintain their inter-relationships in runtime conversation.</li>
</ul>
</li>
</ul>
<h2><strong>Amazon Lex Runtime V2</strong></h2>
<ul>
<li>
<h3>Features</h3>
<ul>
<li>This release is for supporting Composite Slot Type feature in AWS Lex V2. Composite Slot Type will help developer to logically group coherent slots and maintain their inter-relationships in runtime conversation.</li>
</ul>
</li>
</ul>
<h2><strong>Amazon Redshift</strong></h2>
<ul>
<li>
<h3>Features</h3>
<ul>
<li>This release updates documentation for AQUA features and other description updates.</li>
</ul>
</li>
</ul>
<h1><strong>1.12.299</strong> <strong>2022-09-08</strong></h1>
<h2><strong>AWS Elemental MediaLive</strong></h2>
<ul>
<li>
<h3>Features</h3>
<ul>
<li>This change exposes API settings which allow Dolby Atmos and Dolby Vision to be used when running a channel using Elemental Media Live</li>
</ul>
</li>
</ul>
<h2><strong>AWS SDK for Java</strong></h2>
<ul>
<li>
<h3>Features</h3>
<ul>
<li>Adding support for me-central-1 region</li>
</ul>
</li>
</ul>
<h2><strong>Amazon EMR Containers</strong></h2>
<ul>
<li>
<h3>Features</h3>
<ul>
<li>EMR on EKS now allows running Spark SQL using the newly introduced Spark SQL Job Driver in the Start Job Run API</li>
</ul>
</li>
</ul>
<h2><strong>Amazon Elastic Compute Cloud</strong></h2>
<ul>
<li>
<h3>Features</h3>
<ul>
<li>This release adds support to send VPC Flow Logs to kinesis-data-firehose as new destination type</li>
</ul>
</li>
</ul>
<h2><strong>Amazon Lookout for Metrics</strong></h2>
<ul>
<li>
<h3>Features</h3>
<ul>
<li>Release dimension value filtering feature to allow customers to define dimension filters for including only a subset of their dataset to be used by LookoutMetrics.</li>
</ul>
</li>
</ul>
<h2><strong>Amazon Route 53</strong></h2>
<ul>
<li>
<h3>Features</h3>
<ul>
<li>Amazon Route 53 now supports the Middle East (UAE) Region (me-central-1) for latency records, geoproximity records, and private DNS for Amazon VPCs in that region.</li>
</ul>
</li>
</ul>
<h2><strong>Amazon SageMaker Service</strong></h2>
<ul>
<li>
<h3>Features</h3>
<ul>
<li>This release adds Mode to AutoMLJobConfig.</li>
</ul>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/aws/aws-sdk-java/commit/874a8771641b0d825e5f2fb6cd806680f22028e6"><code>874a877</code></a> AWS SDK for Java 1.12.300</li>
<li><a href="https://github.com/aws/aws-sdk-java/commit/48bc7cfbdc9b0806cee3b4a00d72924186dbe70d"><code>48bc7cf</code></a> Update GitHub version number to 1.12.300-SNAPSHOT</li>
<li><a href="https://github.com/aws/aws-sdk-java/commit/b08cda01a176eed97fd6c7823c35747736f95f25"><code>b08cda0</code></a> AWS SDK for Java 1.12.299</li>
<li><a href="https://github.com/aws/aws-sdk-java/commit/ecfdc1f5a9d9e9984bb13cecd3e88ca401640e91"><code>ecfdc1f</code></a> Update GitHub version number to 1.12.299-SNAPSHOT</li>
<li>See full diff in <a href="https://github.com/aws/aws-sdk-java/compare/1.12.298...1.12.300">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=com.amazonaws:aws-java-sdk-core&package-manager=maven&previous-version=1.12.298&new-version=1.12.300)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting ``@dependabot` rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- ``@dependabot` rebase` will rebase this PR
- ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it
- ``@dependabot` merge` will merge this PR after your CI passes on it
- ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it
- ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging
- ``@dependabot` reopen` will reopen this PR if it is closed
- ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

Co-authored-by: Nicolas Pepin-Perreault <nicolas.pepin-perreault@camunda.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Sep 12, 2022
5 parents a4fbbeb + cc5b4d8 + df80e75 + 1451083 + 2f746e2 commit dcf3b25
Show file tree
Hide file tree
Showing 13 changed files with 196 additions and 25 deletions.
4 changes: 2 additions & 2 deletions backup-stores/s3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.17.270</version>
<version>2.17.271</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -134,7 +134,7 @@
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-core</artifactId>
<version>1.12.299</version>
<version>1.12.300</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ Runnable toRunnable(final Task task) {
writeRetryStrategy.runWithRetry(
() -> {
Loggers.PROCESS_PROCESSOR_LOGGER.trace("Write scheduled TaskResult to dispatcher!");
logStreamBatchWriter.reset();
result
.getRecordBatch()
.forEach(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@
import static io.camunda.zeebe.engine.util.RecordToWrite.event;
import static io.camunda.zeebe.protocol.record.intent.ProcessInstanceIntent.ACTIVATE_ELEMENT;
import static io.camunda.zeebe.protocol.record.intent.ProcessInstanceIntent.ELEMENT_ACTIVATING;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.timeout;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import io.camunda.zeebe.engine.Loggers;
import io.camunda.zeebe.engine.api.EmptyProcessingResult;
import io.camunda.zeebe.engine.api.ProcessingResult;
import io.camunda.zeebe.engine.api.ProcessingResultBuilder;
Expand All @@ -32,13 +35,20 @@
import io.camunda.zeebe.engine.util.Records;
import io.camunda.zeebe.engine.util.StreamPlatform;
import io.camunda.zeebe.engine.util.StreamPlatformExtension;
import io.camunda.zeebe.logstreams.log.LoggedEvent;
import io.camunda.zeebe.protocol.impl.record.value.processinstance.ProcessInstanceRecord;
import io.camunda.zeebe.protocol.record.ValueType;
import io.camunda.zeebe.scheduler.clock.ControlledActorClock;
import io.camunda.zeebe.scheduler.future.CompletableActorFuture;
import io.camunda.zeebe.test.util.junit.RegressionTest;
import java.time.Duration;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicInteger;
import org.awaitility.Awaitility;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mockito;
Expand All @@ -55,6 +65,9 @@ public class ProcessingScheduleServiceTest {
@SuppressWarnings("unused") // injected by the extension
private StreamPlatform streamPlatform;

@SuppressWarnings("unused") // injected by the extension
private ControlledActorClock clock;

private DummyProcessor dummyProcessor;

@BeforeEach
Expand Down Expand Up @@ -222,6 +235,71 @@ public void shouldScheduleOnFixedRate() {
.process(Mockito.argThat(record -> record.getKey() == 1), any());
}

@RegressionTest("https://github.com/camunda/zeebe/issues/10240")
@Disabled("Flaky test due to https://github.com/camunda/zeebe/issues/10306; enable once fixed")
void shouldPreserveOrderingOfWritesEvenWithRetries() {
// given
final var dummyProcessorSpy = spy(dummyProcessor);
final var syncLogStream = spy(streamPlatform.createLogStream("stream", 1));
final var logStream = spy(syncLogStream.getAsyncLogStream());
final var batchWriter = spy(syncLogStream.newLogStreamBatchWriter());

when(syncLogStream.getAsyncLogStream()).thenReturn(logStream);
when(logStream.newLogStreamBatchWriter())
.thenReturn(CompletableActorFuture.completed(batchWriter));
streamPlatform
.withRecordProcessors(List.of(dummyProcessorSpy))
.buildStreamProcessor(syncLogStream, true);

// when - in order to make sure we would interleave tasks without the fix for #10240, we need to
// make sure we retry at least twice, such that the second task can be executed in between both
// invocations. ensure both tasks have an expiry far away enough such that they expire on
// different ticks, as tasks expiring on the same tick will be submitted in a non-deterministic
// order
final var counter = new AtomicInteger(0);
when(batchWriter.tryWrite())
.then(
i -> {
final var invocationCount = counter.incrementAndGet();
// wait a sufficiently high enough invocation count to ensure the second timer is
// expired, gets scheduled, and then the executions are interleaved. this is quite
// hard to do in a deterministic controlled way because of the way our timers are
// scheduled
if (invocationCount < 5000) {
return -1L;
}

Loggers.PROCESS_PROCESSOR_LOGGER.debug("Calling real method");
return i.callRealMethod();
});

dummyProcessorSpy.scheduleService.runDelayed(
Duration.ZERO,
builder -> {
// force trigger second task
clock.addTime(Duration.ofMinutes(1));
builder.appendCommandRecord(1, ACTIVATE_ELEMENT, RECORD);
return builder.build();
});
dummyProcessorSpy.scheduleService.runDelayed(
Duration.ofMinutes(1),
builder -> {
Loggers.PROCESS_PROCESSOR_LOGGER.debug("Running second timer");
builder.appendCommandRecord(2, ACTIVATE_ELEMENT, RECORD);
return builder.build();
});

// then
Awaitility.await("until both records are written to the stream")
.atMost(Duration.ofSeconds(10))
.untilAsserted(
() -> assertThat(streamPlatform.events(syncLogStream.getLogName())).hasSize(2));
assertThat(streamPlatform.events(syncLogStream.getLogName()))
.as("records were written in order of submitted tasks")
.extracting(LoggedEvent::getKey)
.containsExactly(1L, 2L);
}

private static final class DummyTask implements Task {
@Override
public TaskResult execute(final TaskResultBuilder taskResultBuilder) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import io.camunda.zeebe.engine.api.RecordProcessor;
import io.camunda.zeebe.engine.api.StreamProcessorLifecycleAware;
import io.camunda.zeebe.engine.state.appliers.EventAppliers;
import io.camunda.zeebe.logstreams.impl.log.LoggedEventImpl;
import io.camunda.zeebe.logstreams.log.LogStreamBatchWriter;
import io.camunda.zeebe.logstreams.log.LogStreamReader;
import io.camunda.zeebe.logstreams.log.LoggedEvent;
Expand All @@ -36,6 +37,7 @@
import io.camunda.zeebe.streamprocessor.StreamProcessor;
import io.camunda.zeebe.streamprocessor.StreamProcessorMode;
import io.camunda.zeebe.util.FileUtil;
import io.camunda.zeebe.util.buffer.BufferUtil;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.nio.file.FileAlreadyExistsException;
Expand Down Expand Up @@ -152,7 +154,22 @@ public Stream<LoggedEvent> events(final String logName) {

final Iterable<LoggedEvent> iterable = () -> reader;

return StreamSupport.stream(iterable.spliterator(), false);
// copy to allow for collecting, which is what AssertJ does under the hood when using stream
// assertions
return StreamSupport.stream(iterable.spliterator(), false)
.map(
event -> {
final var copyableEvent = (LoggedEventImpl) event;
final var copiedBuffer =
BufferUtil.cloneBuffer(
copyableEvent.getBuffer(),
copyableEvent.getFragmentOffset(),
copyableEvent.getLength());
final var copy = new LoggedEventImpl();
copy.wrap(copiedBuffer, 0);

return copy;
});
}

public Path createRuntimeFolder(final SynchronousLogStream stream) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@

import io.camunda.zeebe.engine.state.DefaultZeebeDbFactory;
import io.camunda.zeebe.scheduler.ActorScheduler;
import io.camunda.zeebe.scheduler.clock.ActorClock;
import io.camunda.zeebe.scheduler.clock.ControlledActorClock;
import io.camunda.zeebe.util.FileUtil;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Collections;
import org.agrona.CloseHelper;
import org.junit.jupiter.api.extension.BeforeEachCallback;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.api.extension.ExtensionContext.Namespace;
Expand Down Expand Up @@ -67,6 +69,20 @@ private void injectFields(
ExceptionUtils.throwAsUncheckedException(t);
}
});
ReflectionUtils.findFields(
testClass,
field ->
ReflectionUtils.isNotStatic(field)
&& ActorClock.class.isAssignableFrom(field.getType()),
HierarchyTraversalMode.TOP_DOWN)
.forEach(
field -> {
try {
makeAccessible(field).set(testInstance, lookupOrCreate(extensionContext).clock);
} catch (final Throwable t) {
ExceptionUtils.throwAsUncheckedException(t);
}
});
}

private static final class StreamProcessorTestContext implements CloseableResource {
Expand Down Expand Up @@ -106,9 +122,8 @@ public StreamProcessorTestContext() {
@Override
public void close() throws Exception {
Collections.reverse(closables);
for (final var closeable : closables) {
closeable.close();
}
CloseHelper.quietCloseAll(closables);
closables.clear();
}
}
}
2 changes: 1 addition & 1 deletion parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<version.prometheus>0.16.0</version.prometheus>
<version.protobuf>3.21.5</version.protobuf>
<version.protobuf-common>2.9.2</version.protobuf-common>
<version.micrometer>1.9.3</version.micrometer>
<version.micrometer>1.9.4</version.micrometer>
<version.rocksdbjni>7.5.3</version.rocksdbjni>
<version.sbe>1.26.0</version.sbe>
<version.scala>2.13.8</version.scala>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public final class AbortableRetryStrategy implements RetryStrategy {

public AbortableRetryStrategy(final ActorControl actor) {
this.actor = actor;
retryMechanism = new ActorRetryMechanism(actor);
retryMechanism = new ActorRetryMechanism();
}

@Override
Expand All @@ -44,7 +44,7 @@ private void run() {
try {
final var control = retryMechanism.run();
if (control == Control.RETRY) {
actor.submit(this::run);
actor.run(this::run);
}
} catch (final Exception exception) {
currentFuture.completeExceptionally(exception);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,14 @@
*/
package io.camunda.zeebe.scheduler.retry;

import io.camunda.zeebe.scheduler.ActorControl;
import io.camunda.zeebe.scheduler.future.ActorFuture;
import java.util.function.BooleanSupplier;

public final class ActorRetryMechanism {

private final ActorControl actor;

private OperationToRetry currentCallable;
private BooleanSupplier currentTerminateCondition;
private ActorFuture<Boolean> currentFuture;

public ActorRetryMechanism(final ActorControl actor) {
this.actor = actor;
}

void wrap(
final OperationToRetry callable,
final BooleanSupplier condition,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public final class EndlessRetryStrategy implements RetryStrategy {

public EndlessRetryStrategy(final ActorControl actor) {
this.actor = actor;
retryMechanism = new ActorRetryMechanism(actor);
retryMechanism = new ActorRetryMechanism();
}

@Override
Expand All @@ -50,15 +50,15 @@ private void run() {
try {
final var control = retryMechanism.run();
if (control == Control.RETRY) {
actor.submit(this::run);
actor.run(this::run);
}
} catch (final Exception exception) {
if (terminateCondition.getAsBoolean()) {
currentFuture.complete(false);
} else {
actor.submit(this::run);
actor.run(this::run);
LOG.error(
"Catched exception {} with message {}, will retry...",
"Caught exception {} with message {}, will retry...",
exception.getClass(),
exception.getMessage(),
exception);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public final class RecoverableRetryStrategy implements RetryStrategy {

public RecoverableRetryStrategy(final ActorControl actor) {
this.actor = actor;
retryMechanism = new ActorRetryMechanism(actor);
retryMechanism = new ActorRetryMechanism();
}

@Override
Expand All @@ -47,11 +47,11 @@ private void run() {
try {
final var control = retryMechanism.run();
if (control == Control.RETRY) {
actor.submit(this::run);
actor.run(this::run);
}
} catch (final RecoverableException ex) {
if (!terminateCondition.getAsBoolean()) {
actor.submit(this::run);
actor.run(this::run);
}
} catch (final Exception exception) {
currentFuture.completeExceptionally(exception);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import io.camunda.zeebe.scheduler.testing.ControlledActorSchedulerRule;
import java.lang.reflect.Constructor;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -116,6 +117,44 @@ public void shouldAbortOnOtherException() {
assertThat(resultFuture.getException()).isExactlyInstanceOf(RuntimeException.class);
}

@Test
public void shouldNotInterleaveRetry() {
// given
final AtomicReference<ActorFuture<Boolean>> firstFuture = new AtomicReference<>();
final AtomicReference<ActorFuture<Boolean>> secondFuture = new AtomicReference<>();

final AtomicInteger executionAttempt = new AtomicInteger(0);
final AtomicInteger firstResult = new AtomicInteger();
final AtomicInteger secondResult = new AtomicInteger();

// when
final var retryCounts = 5;
actorControl.run(
() ->
firstFuture.set(
retryStrategy.runWithRetry(
() -> {
firstResult.set(executionAttempt.getAndIncrement());
return executionAttempt.get() >= retryCounts;
})));
actorControl.run(
() ->
secondFuture.set(
retryStrategy.runWithRetry(
() -> {
secondResult.set(executionAttempt.getAndIncrement());
return true;
})));

schedulerRule.workUntilDone();

// then
assertThat(firstFuture.get()).isDone().isNotEqualTo(secondFuture.get());
assertThat(secondFuture.get()).isDone();
assertThat(firstResult).hasValue(retryCounts - 1);
assertThat(secondResult).hasValue(retryCounts);
}

private static final class ControllableActor extends Actor {
public ActorControl getActor() {
return actor;
Expand Down
1 change: 0 additions & 1 deletion test-util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>

<dependency>
Expand Down
Loading

0 comments on commit dcf3b25

Please sign in to comment.