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

Deactivate #647

Merged
merged 15 commits into from
Oct 23, 2024
Merged

Deactivate #647

merged 15 commits into from
Oct 23, 2024

Conversation

manojdbos
Copy link
Contributor

An admin api to stop scheduler and kafka consumers from processing events.

Processing will resume only when u restart the app

@@ -928,6 +932,13 @@ export class DBOSExecutor implements DBOSExecutorContext {
return handlerArray;
}

async deactivateConsumers() {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: deactivateEventReceivers would be more consistent :)

src/httpServer/server.ts Outdated Show resolved Hide resolved
src/dbos-executor.ts Outdated Show resolved Hide resolved
for (const evtRcvr of this.eventReceivers || []) {
await evtRcvr.destroy();
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Does this also shut down the queue polling loop, or does that need to be done elsewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I assume you are referring to the WF Queue runner. Will add the code to shut that down as well

@manojdbos manojdbos marked this pull request as ready for review October 21, 2024 14:32
@chuck-dbos
Copy link
Collaborator

I wonder if we can put this together into one PR. I needed to restart some of the services in the testing runtime to test their makeup work.

@manojdbos
Copy link
Contributor Author

I wonder if we can put this together into one PR. I needed to restart some of the services in the testing runtime to test their makeup work.

@chuck-dbos I did not understand the comment. Do you want to combine this PR with another PR ?

@chuck-dbos
Copy link
Collaborator

In a recent PR I added a function called "async destroyEventReceivers" to testing runtime. We should make the one in the real runtime the same, maybe combine into one function.

In the next PR, I found I want to call this during a test to simulate shutdown and restart. But this wasn't part of the public API of the testing runtime, so I temporarily hacked it on that branch.

I am wondering if we can put all the pieces together into one, public API method, that exists on both the real and the test runtime, that deactivates all of the background stuff (event receivers, scheduler, internal kafka) and one to start it back again.

@chuck-dbos chuck-dbos merged commit 9f293e5 into main Oct 23, 2024
2 checks passed
@chuck-dbos chuck-dbos deleted the deactivate branch October 23, 2024 15:35
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.

4 participants