forked from phoenix-oss/llama-stack-mirror
fix: add shutdown method for ProviderImpl (#1670)
# What does this PR do? Currently there is no shutdown method implemented for the `ProviderImpl` class This leads to the following warning ```shell INFO: Waiting for application shutdown. INFO 2025-03-17 17:25:13,280 __main__:145 server: Shutting down INFO 2025-03-17 17:25:13,282 __main__:129 server: Shutting down ModelsRoutingTable INFO 2025-03-17 17:25:13,284 __main__:129 server: Shutting down DatasetsRoutingTable INFO 2025-03-17 17:25:13,286 __main__:129 server: Shutting down DatasetIORouter INFO 2025-03-17 17:25:13,287 __main__:129 server: Shutting down TelemetryAdapter INFO 2025-03-17 17:25:13,288 __main__:129 server: Shutting down InferenceRouter INFO 2025-03-17 17:25:13,290 __main__:129 server: Shutting down ShieldsRoutingTable INFO 2025-03-17 17:25:13,291 __main__:129 server: Shutting down SafetyRouter INFO 2025-03-17 17:25:13,292 __main__:129 server: Shutting down VectorDBsRoutingTable INFO 2025-03-17 17:25:13,293 __main__:129 server: Shutting down VectorIORouter INFO 2025-03-17 17:25:13,294 __main__:129 server: Shutting down ToolGroupsRoutingTable INFO 2025-03-17 17:25:13,295 __main__:129 server: Shutting down ToolRuntimeRouter INFO 2025-03-17 17:25:13,296 __main__:129 server: Shutting down MetaReferenceAgentsImpl INFO 2025-03-17 17:25:13,297 __main__:129 server: Shutting down ScoringFunctionsRoutingTable INFO 2025-03-17 17:25:13,298 __main__:129 server: Shutting down ScoringRouter INFO 2025-03-17 17:25:13,299 __main__:129 server: Shutting down BenchmarksRoutingTable INFO 2025-03-17 17:25:13,300 __main__:129 server: Shutting down EvalRouter INFO 2025-03-17 17:25:13,301 __main__:129 server: Shutting down DistributionInspectImpl INFO 2025-03-17 17:25:13,303 __main__:129 server: Shutting down ProviderImpl WARNING 2025-03-17 17:25:13,304 __main__:134 server: No shutdown method for ProviderImpl INFO: Application shutdown complete. INFO: Finished server process [1] ``` ## Test Plan Start a server and shut it down Signed-off-by: Nathan Weinberg <nweinber@redhat.com>
This commit is contained in:
parent
252a487085
commit
e48af78b76
1 changed files with 7 additions and 0 deletions
|
@ -8,10 +8,13 @@
|
|||
from pydantic import BaseModel
|
||||
|
||||
from llama_stack.apis.providers import ListProvidersResponse, ProviderInfo, Providers
|
||||
from llama_stack.log import get_logger
|
||||
|
||||
from .datatypes import StackRunConfig
|
||||
from .stack import redact_sensitive_fields
|
||||
|
||||
logger = get_logger(name=__name__, category="core")
|
||||
|
||||
|
||||
class ProviderImplConfig(BaseModel):
|
||||
run_config: StackRunConfig
|
||||
|
@ -31,6 +34,10 @@ class ProviderImpl(Providers):
|
|||
async def initialize(self) -> None:
|
||||
pass
|
||||
|
||||
async def shutdown(self) -> None:
|
||||
logger.debug("ProviderImpl.shutdown")
|
||||
pass
|
||||
|
||||
async def list_providers(self) -> ListProvidersResponse:
|
||||
run_config = self.config.run_config
|
||||
safe_config = StackRunConfig(**redact_sensitive_fields(run_config.model_dump()))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue