-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Temporal activity heartbeat from incorrect thread fix #11878
Temporal activity heartbeat from incorrect thread fix #11878
Conversation
@@ -48,7 +48,7 @@ public void checkAndHandleCancellation(final Runnable onCancellationCallback) { | |||
* {@link TemporalUtils#withBackgroundHeartbeat} for where we actually send heartbeats to ensure | |||
* that we don't time out the activity. | |||
*/ | |||
context.heartbeat(null); | |||
activityContext.heartbeat(null); | |||
} catch (final ActivityCompletionException e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jrhizor Since the cancellation handler is being called from scheduled background threads to initiate heartbeats I think that it should also handle generic exceptions in case there are some transient errors such as networking errors. The current implementation fails to do that which will lead to the scheduled executor service swallowing the exception and stopping all further work of the thread, including scheduling it again. Otherwise this case will need to be handled in the scheduleAtFixedRate() lambda definition.
Hello @itaseskii, Thanks for your submission. It look good to me, there is many changes that seems to be format related. Could you run Thanks, |
@itaseskii are you able to build |
Ivica seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
@benmoriceau Done. Some reformats are intentional such as moving the lambdas in new lines when calling TemporalUtils.withBackgroundHeartbeat() |
Hello @itaseskii, Thanks again for your contribution! |
@itaseskii #12152 is green, I don't know what the issue is with the license agreement. Let me know if you want me to merge the PR if you don't manage to fix the licence issue. |
@benmoriceau I have already signed the agreement with my itaseskii git username. I was reinstalling my machine and I pushed some changes without configuring my git info and that is why it show that Ivica hasn't signed the agreement. btw should we address this #11878 (comment) before merging? 🤔 |
I don't think it should block the merge, but this is something that we need to address. I'll create an issue for it. |
@benmoriceau great. I am willing to fix it if that is okay with you :) |
I have merge it. Thanks for willing to fix it! |
Awesome. Have you maybe created an issue for it? |
* fix activity context retrieval * add heartbeat unit tests * use cancelation handler for heartbeats * use await for blocking * format code Co-authored-by: Ivica <itaseski@debian-BULLSEYE-live-builder-AMD64>
What
Fix activity heartbeats from incorrect thread as explained here #11515.
How
Retrieving the activity context directly in the activity implementation to avoid leaving the scope of the current thread.
Recommended reading order
x.java
y.python
🚨 User Impact 🚨
Are there any breaking changes? What is the end result perceived by the user? If yes, please merge this PR with the 🚨🚨 emoji so changelog authors can further highlight this if needed.
Pre-merge Checklist
Expand the relevant checklist and delete the others.
New Connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/SUMMARY.md
docs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampledocs/integrations/README.md
airbyte-integrations/builds.md
Airbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing/publish
command described hereUpdating a connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampleAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing/publish
command described hereConnector Generator
-scaffold
in their name) have been updated with the latest scaffold by running./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates
then checking in your changesTests
Unit
Put your unit tests output here.
Integration
Put your integration tests output here.
Acceptance
Put your acceptance tests output here.
┆Issue is synchronized with this Monday item by Unito