apache / apache/hamilton

Stop python process from exiting too early with async tracker still having data to send

Open
#1,214 0 comments 0 reactions 0 assignees View on GitHub
async bug SDK
Dominant language
Jupyter Notebook
Stars
2.6k
Forks
213
PR merge metrics
No merged PRs in 30d

Description

# Current behavior
If you're in aws lamdba, the lambda can kill the event loop before we manage to send all events.
This means that things complete, but we're missing data for a few nodes/functions.

## Steps to replicate behavior
This is hard to recreate locally unless you kill the process immediately after the driver finished executing.
1. run async driver logging to tracker
2. immediate kill process

## Library & System Information
latest

# Expected behavior
The tracker should be able to register something with python to say "hey run this before the process closes" to ensure the events get sent -- we do this with registering `stop()` with the sync client.

# Additional context
Asyncio and atexit don't seem to play well together. There seems to be a library that could help. But yeah could be easy, or could be digging into the internals of python to figure this out.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.