Skip to content

Refactor benchmark handling of running mode #3964

Closed

Description

@ajpotts

Examine the best way to handle running mode for the benchmarks.

Activity

  1. ajpotts commented on Jan 8, 2025

    @ajpotts
    ContributorAuthor

    @vasslitvinov reported the following concerns:

    In the CLASS_SERVER mode, startup_teardown() indeeds starts a server, however that server is unused. Instead the tests connect to the server specified in ARKOUDA_SERVER_HOST. If there isn’t one, the tests hang.
    In the GLOBAL_SERVER mode, I do not see that the server starts at all. Again, the tests hang. I think this is not the intended behavior.
    benchmark.ini defines ARKOUDA_RUNNING_MODE=CLASS_SERVER whereas benchmark_v2/conftest.py defaults to GLOBAL_SERVER if ARKOUDA_RUNNING_MODE is unset. This is confusing. benchmark.ini also defines the host and the port, with benchmark_v2/conftest.py again providing the defaults, this time consistently.
    My suggestion is to remove these settings from benchmark.ini, relying directly on benchmark_v2/conftest.py.

  2. self-assigned this
    on Jan 8, 2025
  3. added this to the Update Benchmarks milestone on Jan 8, 2025
  4. vasslitvinov commented on Jan 8, 2025

    @vasslitvinov
    Contributor

    Within Python, the information from startup_teardown() to connect() flows as a string with the host name. If two servers are launched, for example, on localhost, then it is easy to use one instead of the other. The issue is more obvious when servers are launched, for example, on two different compute nodes of a bigger system.

    I also have a fear that we may accidentally overwrite the serverConnectionInfo file because two server launches use the same location, e.g., when launching a server per class. Not sure this is a real issue though, as hopefully we delete this file after we read it. (???)

  5. added 4 commits that reference this issue on Apr 30, 2025
    d32e08f
    c00e987
    0a2c6ab
    6d3aa4d
  6. ajpotts commented on May 1, 2025

    @ajpotts
    ContributorAuthor

    I believe in GLOBAL_SERVER mode it's not supposed to start a server, but rather connect to an existing server.

  7. added a commit that references this issue on May 1, 2025
  8. ajpotts commented on May 1, 2025

    @ajpotts
    ContributorAuthor

    In regards to your concern about the serverConnectionInfo file, this section of the arkouda code:

            /*
            Creates the serverConnectionInfo file on arkouda_server startup
            */
            proc createServerConnectionInfo() throws {
           ....
            }
    
            /*
            Deletes the serverConnetionFile on arkouda_server shutdown
            */
            proc deleteServerConnectionInfo() throws {
            ....
            }
    

    Indicates that it will be deleted upon server shutdown.

  9. ajpotts commented on May 1, 2025

    @ajpotts
    ContributorAuthor

    According to ChatGPT:

    Under normal, single-process pytest runs with a module-scoped fixture, you’ll only ever have one Arkouda server up at a time:

    Module scope → one start/stop per module

    Pytest will call your arkouda_server fixture once at the top of each test module that needs it, then tear it down before moving on.

    Because teardown happens before the next module’s setup, there’s never any overlap within a single pytest worker.

    Session scope → one start/stop per entire run

    If you bump your fixture to scope="session", then you get one start at the very beginning and one stop at the very end—still serial, still no overlap.

    The only time you’ll see multiple servers live at once is if you run pytest in parallel with something like pytest-xdist (multiple worker processes). Each worker is its own Python process and will independently:

    import your fixtures

    start its own server (on the same port, which will actually cause bind errors unless you adjust it)

    tear it down

    So by default, single-process → no concurrent servers. But if you parallelize across N xdist workers, you’ll end up with N “simultaneous” server startups (and likely port conflicts).

  10. ajpotts commented on May 1, 2025

    @ajpotts
    ContributorAuthor

    So as long as we're not running with xdist, it should be OK....

  11. vasslitvinov commented on May 1, 2025

    @vasslitvinov
    Contributor

    That's reassuring, thanks for looking into it!

    For a more general case, I suggest that the default returned by get_arkouda_server_info_file() contains some unique string, perhaps uuid.uuid4().hex[:4], ex. "ak-server-info.1234" .

  12. added a commit that references this issue on May 1, 2025
  13. 7 remaining items

  14. added a commit that references this issue on May 8, 2025
  15. added 9 commits that reference this issue on May 8, 2025
  16. added a commit that references this issue on May 20, 2025
  17. added 2 commits that reference this issue on May 30, 2025
    74ea047
    a0ab911
  18. added a commit that references this issue on Jun 5, 2025
    106cf76
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions