Has anyone seen containers exit with code 139 and ...
# flyte-v2-support
c
Has anyone seen containers exit with code 139 and seemingly no terminal problems?
Copy code
2026-10-28 17:42:35.484 warn [flyte] WARNING Flyte runtime started for action 3wu4gxyvfsynwhng72txh88sc with run name rs65mqj5bqrcnj4vrk4q
2026-10-28 17:43:48.684 error [rs65mqj5bqrcnj4vrk4q][3wu4gxyvfsynwhng72txh88sc] [flyte] ERROR RPC error: rs65mqj5bqrcnj4vrk4q.3wu4gxyvfsynwhng72txh88sc, Error reading content
2026-10-28 17:43:48.684 warn [rs65mqj5bqrcnj4vrk4q][3wu4gxyvfsynwhng72txh88sc] [flyte] WARNING Watch for rs65mqj5bqrcnj4vrk4q.3wu4gxyvfsynwhng72txh88sc failed, retrying in 2.0 seconds...
2026-10-28 17:43:50.687 warn [rs65mqj5bqrcnj4vrk4q][3wu4gxyvfsynwhng72txh88sc] [flyte] WARNING Informer watch retrying, attempt 1/40
2026-10-28 17:45:59.449 warn [flyte] WARNING Flyte runtime completed for action 3wu4gxyvfsynwhng72txh88sc with run name rs65mqj5bqrcnj4vrk4q
Looks like it may be some Rust segfault?
Modified the client to actually dump out the error. It seems like it completes later thought and exits 139 for some reason
Copy code
The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File ".../rules_python++pip+pip_312_flyte_py3_none_any_de8577c0/site-packages/flyte/_internal/controllers/remote/_informer.py", line 260, in watch
    async for resp in cast(AsyncIterator, watcher):
  File ".../rules_python++pip+pip_312_connectrpc_py3_none_any_6e965625/site-packages/connectrpc/_interceptor_async.py", line 203, in intercept_server_stream
    async for response in call_next(request, ctx):
  File ".../rules_python++pip+pip_312_flyte_py3_none_any_de8577c0/site-packages/flyte/remote/_client/auth/_interceptors/auth.py", line 149, in intercept_server_stream
    async for response in call_next(request, ctx):
  File ".../rules_python++pip+pip_312_connectrpc_py3_none_any_6e965625/site-packages/connectrpc/_client_async.py", line 428, in _send_request_bidi_stream
    raise rst_err from e
connectrpc.errors.ConnectError: Error reading content
[r928w764p69njlfrvtgf][4lyxrv2g9mg1kx1hs7i5lpwaz] [flyte] WARNING Watch for r928w764p69njlfrvtgf.4lyxrv2g9mg1kx1hs7i5lpwaz failed, retrying in 2.0 seconds...
[r928w764p69njlfrvtgf][4lyxrv2g9mg1kx1hs7i5lpwaz] [flyte] WARNING Informer watch retrying, attempt 1/40
[flyte] WARNING Flyte runtime completed for action 4lyxrv2g9mg1kx1hs7i5lpwaz with run name r928w764p69njlfrvtgf
Added some additional environment variables and now I see this..
Copy code
[flyte] WARNING Flyte runtime completed for action 538rcte47dii57dq0wcity8n4 with run name rltpcccn57ghf75lzql9
Fatal Python error: Segmentation fault

Thread 0x
It seems there are some issues with shutdown in the SDK informer code.. I'll put up a pull request tomorrow.
👍 1
Filed a PR: github.com/flyteorg/flyte-sdk/pull/1727 Heavily AI assisted since I'm not familiar with the SDK architecture so feel free to tear it apart
f
ya we will try to reprduce
do you have an example
c
Sure... I think its related to the node network or throttling on the actions service side so I think you'll have trouble reproducing the issue. It only happens under high concurrency
Happens with something similar to this
Copy code
"""Flyte 2 scale workload with two levels of fanout over square tasks."""

import asyncio
import logging
from functools import partial
from typing import TYPE_CHECKING, Final

import flyte

if TYPE_CHECKING:
    from collections.abc import Awaitable, Callable, Coroutine, Iterable

map_env: Final = flyte.TaskEnvironment(
    name="scale_map_env",
    resources=flyte.Resources(cpu="300m", memory="300Mi"),
)
env: Final = flyte.TaskEnvironment(name="scale_fanout_env", depends_on=[map_env])
_FIRST_LEVEL_FANOUT: Final = 100
_CHILD_RETRY_DELAYS: Final = (5, 10, 20)
_CHILD_LAUNCH_DELAY: Final = 0.05
_logger: Final = logging.getLogger(__name__)


async def _gather_staggered(calls: "Iterable[Coroutine[None, None, int]]") -> list[int]:
    """Launch children 50 ms apart and collect their results in input order."""
    tasks: list[asyncio.Task[int]] = []
    try:
        for call in calls:
            tasks.append(asyncio.create_task(call))
            await asyncio.sleep(_CHILD_LAUNCH_DELAY)
        return await asyncio.gather(*tasks)
    finally:
        for task in tasks:
            if not task.done():
                task.cancel()
        await asyncio.gather(*tasks, return_exceptions=True)


@map_env.task
def simple_map_task(a: int) -> int:
    """Square one input in a separate task."""
    return a * a


async def _with_child_retries(call: "Callable[[], Awaitable[int]]") -> int:
    """Retry a failed child up to three times with exponential backoff."""
    for delay in _CHILD_RETRY_DELAYS:
        try:
            return await call()
        except Exception:
            _logger.warning("Child task failed; retrying in %s seconds", delay, exc_info=True)
            await asyncio.sleep(delay)
    return await call()


@env.task
def simple_reduce(b: list[int]) -> int:
    """Sum the completed map task outputs."""
    return sum(b)


@env.task
async def fanout_task(branch_index: int, size: int) -> int:
    """Fan out square tasks over one branch's share of the inputs, then sum them."""
    output = await _gather_staggered(
        _with_child_retries(partial(simple_map_task.aio, a=value))
        for value in range(branch_index, size, _FIRST_LEVEL_FANOUT)
    )
    return await _with_child_retries(partial(simple_reduce.aio, b=output))


@env.task
async def wf(size: int = 1000) -> int:
    """Split size integers across 100 child tasks, then sum their squared results."""
    output = await _gather_staggered(
        _with_child_retries(partial(fanout_task, branch_index=branch_index, size=size))
        for branch_index in range(_FIRST_LEVEL_FANOUT)
    )
    return await _with_child_retries(partial(simple_reduce.aio, b=output))
I added try/except because we hit issues with the parallelism and loading inputs from the metadata store (blob store). We are able to work around that which is probably an issue on our end. But our Armada plugin doesn't like it when pods don't exit code 0 and the seg fault gets triggered with the
Watch
retries.