Skip to content

Conversation

@Sushisource
Copy link
Member

Allows the lang SDK to ensure server will no longer be polled while performing orderly shutdown.

Depends on #46 being merged first.

@Sushisource Sushisource requested a review from vitarb as a code owner February 12, 2021 20:04
# Conflicts:
#	src/lib.rs
#	src/machines/test_help/mod.rs
#	tests/integ_tests/simple_wf_tests.rs
@Sushisource Sushisource enabled auto-merge (squash) February 12, 2021 20:14
/// replay have an opportunity to finish. This means that the lang sdk will need to call
/// [Core::complete_task] for those workflows until they are done. At that point, the lang
/// SDK can end the process, or drop the [Core] instance, which will close the connection.
fn shutdown(&self) -> Result<()>;
Copy link
Member

Choose a reason for hiding this comment

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

In Java we have two ways to shutdown: shutdown and shutdown now. The former is a clean shutdown and the latter is an immediate shutdown without waiting for tasks to complete.
There is also awaitTermination that allows waiting for shutdown for a specified timeout.

I think we need to support all the above features. But I'm not saying the API should be the same.

Copy link
Member Author

Choose a reason for hiding this comment

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

@mfateev Not sure either of those actually belong in core. Lang SDK can decide all by itself if it wants to exit abruptly (it can just terminate the process) -- same with the timeout. If it has not polled core enough to drain the queue completely, it can know that and decide to terminate then as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

Gonna merge this so I can use it in some of the existing PRs, but we can definitely come back to this if needed.

@Sushisource Sushisource disabled auto-merge February 18, 2021 23:20
@Sushisource Sushisource enabled auto-merge (squash) February 24, 2021 06:12
@Sushisource Sushisource merged commit cfff382 into temporalio:master Feb 24, 2021
@Sushisource Sushisource deleted the shutdown-api branch February 24, 2021 06:18
Sushisource added a commit to Sushisource/sdk-core that referenced this pull request Apr 1, 2021
Allows the lang SDK to ensure server will no longer be polled while performing orderly shutdown.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants