Skip to content

Commit a06adc7

Browse files
authored
kill process on panic (#164)
1 parent 0a8bdde commit a06adc7

File tree

4 files changed

+45
-18
lines changed

4 files changed

+45
-18
lines changed

livekit-rtc/livekit/rtc/_ffi_client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import signal
1516
import asyncio
1617
from contextlib import ExitStack
1718
import ctypes
@@ -145,6 +146,11 @@ def ffi_event_callback(
145146
)
146147

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

149155
FfiClient.instance.queue.put(event)
150156

livekit-rtc/livekit/rtc/_proto/ffi_pb2.py

Lines changed: 16 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)