Skip to content

Exclude warmed containers in disabled invokers. #5313

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

Merged
merged 5 commits into from
Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -376,34 +376,21 @@ class FPCInvokerReactive(config: WhiskConfig,
override def enable(): Route = {
invokerHealthManager ! Enable
pool ! Enable
// re-enable consumer
if (consumer.isEmpty)
consumer = Some(
new ContainerMessageConsumer(
instance,
pool,
entityStore,
cfg,
msgProvider,
longPollDuration = 1.second,
maxPeek,
sendAckToScheduler))
warmUp()
complete("Success enable invoker")
}

override def disable(): Route = {
invokerHealthManager ! GracefulShutdown
pool ! GracefulShutdown
consumer.foreach(_.close())
consumer = None
Copy link
Member

Choose a reason for hiding this comment

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

Even if the invoker is disabled, it handles messages that may come in for a while. 👍

warmUpWatcher.foreach(_.close())
warmUpWatcher = None
consumer.foreach(_.close())
complete("Successfully disabled invoker")
}

override def isEnabled(): Route = {
complete(InvokerEnabled(consumer.nonEmpty && warmUpWatcher.nonEmpty).serialize())
complete(InvokerEnabled(warmUpWatcher.nonEmpty).serialize())
}

override def backfillPrewarm(): Route = {
Expand Down
Loading