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

Please add a client notification to the agent termination event #1147

Open
mykola-mokhnach-parloa opened this issue Nov 28, 2024 · 1 comment
Labels
question Further information is requested

Comments

@mykola-mokhnach-parloa
Copy link

mykola-mokhnach-parloa commented Nov 28, 2024

Currently there is no way from the cli client code to know when the agent received SIGTERM or SIGINT and is in the graceful shutdown state. It would be useful to have a possibility for it to emit an event or provide a possibility to assign a callback, so one could execute a custom code when that happens.

Related to livekit/livekit-helm#116

@mykola-mokhnach-parloa mykola-mokhnach-parloa added the question Further information is requested label Nov 28, 2024
@peter-assort
Copy link

+1 that would be nice!

FWIW you can do "cleanup" on the "job/worker" level using :

            # https://docs.livekit.io/agents/build/session/#post-processing-and-cleanup
            # Just add some logging when shutdown is initiated
            async def my_shutdown_hook() -> None:
                self._log_on_livekit_event_sync("shutdown callback")

            self.ctx.add_shutdown_callback(my_shutdown_hook)

If you feel real hacky, you can overwrite their SIGTERM catch in the JobEntry func,
but that can be dangerous you had been warned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants