Skip to content

test_mem_leak_in_event_listener flakes because job_not_running leaks tag_map entries #70152

Open

Description

@dwoz

tests/pytests/integration/netapi/rest_tornado/test_minions_api_handler.py::test_mem_leak_in_event_listener intermittently fails with AssertionError: assert 2 == 0 for app.event_listener.tag_map.

Observed on the 3008.x nightly (Amazon Linux 2 integration zeromq 4, run 32913591224 job 98023096704) — first attempt fails with two salt/job/<jid>/ret prefix-matcher futures left in tag_map, retry passes. Same pattern reproduced on merge-forward PR #70132.

Root cause: saltnado.py::_disbatch_local spawns job_not_running via ioloop.spawn_callback to ping saltutil.find_job. When the outer job's is_finished completes first, job_not_running calls event.set_result(None) on the in-flight ping future but does not remove it from event_listener.tag_map / timeout_map. Because spawn_callback runs independently of the handler, the ping may be registered after on_finish -> clean_by_request has already emptied request_map for the handler, so the leaked entry only clears when the gather_job_timeout callback fires (10 s default, 30 s under the netapi test fixture).

The test only allows a 1 s wait before asserting the maps are empty, so any leaked ping trips the assertion.

Activity

  1. added
    bug
    severity-medium
    on Aug 27, 2026
  2. added this to the Argon v3008.3 milestone on Aug 27, 2026
  3. assigned
    and
    dwoz
    and unassigned on Oct 14, 2026
  4. added a commit that references this issue on Oct 21, 2026
    753a1e7
  5. dwoz commented on Oct 23, 2026

    @dwoz
    ContributorAuthor

    Closing as part of a backlog cleanup — this issue was filed without a Salt versions-report, so there's no explicit version attached to compare against.

    If you (or anyone else) can still reproduce this on 3008.3 or later, please comment with:

    • A fresh reproduction
    • The output of salt --versions-report

    and the issue will be reopened. The original reporter can also reopen directly.

  6. reopened this on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugseverity-medium

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions