Skip to content

Legacy RNG global generator becomes stale across server restart, causing UnknownSymbolError in seed() #5318

@ajpotts

Description

@ajpotts

Problem:
CI fails with:
RuntimeError: Error executing command delGenerator: UnknownSymbolError ... unknown symbol

This occurs when ak.random.seed() attempts to delete the legacy global RNG generator using a symbol name that no longer exists on the server. The client-side global (theGenerator) persists across Arkouda server restarts / reconnects, but the server symbol table does not.

Trigger:
Recent changes to test ordering (adding random_legacy_alignment tests) expose this bug by causing ak.random.seed() to be called after a server reset.

Expected Behavior:
Calling ak.random.seed() should be robust even if a previous global generator was already deleted or lost due to a server restart.

Actual Behavior:
ak.random.seed() calls theGenerator.destructor(), which unconditionally sends delGenerator for a stale symbol name, causing CI failure.

Root Cause:
Legacy RNG uses a module-level global generator handle that is not reset when the Arkouda server restarts or the client reconnects.

Proposed Fixes (preferred order):

  1. Make ak.random.seed() tolerant of missing generators by ignoring UnknownSymbolError during destructor.
  2. Reset legacy RNG global state on Arkouda connect/disconnect.
  3. (Less ideal) Test-side mitigation to enforce consistent server lifecycle.

Files Involved:

  • arkouda/numpy/random/legacy.py
  • arkouda/numpy/random/generator.py
  • tests/numpy/random_test.py

Acceptance Criteria:

  • ak.random.seed() no longer fails after server restarts.
  • CI passes regardless of test ordering.
  • No regression in RNG reproducibility tests.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions