Skip to content

v0.2.04

Choose a tag to compare

@jstevenscl jstevenscl released this 17 May 23:12

What's fixed

Two root causes of Docker OOM crashes and uWSGI memory pressure:

1. Signal handler running Fill EPG N times per refresh cycle

The EPG refresh signal fired _action_sxm_fill_epg once per EPG source. With 4+ sources refreshing simultaneously, this spawned N parallel fill runs — each allocating 200–300 MB — causing OOM and Docker daemon crashes. Fixed with a 4-hour cooldown (SXM_FILL_COOLDOWN_SECS) so the fill runs at most once per cooldown window regardless of how many sources trigger the signal.

2. ET.fromstring building full 246k-programme XML DOM in memory

ET.fromstring(xml_bytes) allocated the entire XML DOM (~200 MB) in one shot. In uWSGI without max-requests, Python's allocator holds that heap permanently in the worker process — it never returns to the OS. Replaced with ET.iterparse + elem.clear() streaming — peak XML memory is now ~5 MB and is released when the function exits.

Also fixed: removed prefetch_related("programs") from _do_transform_source — switched to .iterator(chunk_size=) queries to avoid loading all ProgramData into a Python list at once.

Stress test results

4 consecutive Fill & Sort runs on a live instance after a clean Docker restart — uWSGI memory stayed flat throughout. 733 channels, 246,205 programs each run.

Upgrade

Replace your existing plugin zip with epgeditarr-v0.2.04.zip via Plugins → Import Plugin → overwrite.