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

kill process on panic #164

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions livekit-rtc/livekit/rtc/_ffi_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import signal
import asyncio
from contextlib import ExitStack
import ctypes
Expand Down Expand Up @@ -145,6 +146,11 @@ def ffi_event_callback(
)

return # no need to queue the logs
elif which == "panic":
logger.critical("Panic: %s", event.panic.message)
# We are in a unrecoverable state, terminate the process
os.kill(os.getpid(), signal.SIGTERM)
return

FfiClient.instance.queue.put(event)

Expand Down
30 changes: 16 additions & 14 deletions livekit-rtc/livekit/rtc/_proto/ffi_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading