Skip to content

Client.close(true) does not release underlying event loop #603

Open
@matveym

Description

@matveym

While running tests from different modules via Jest I encountered an issue that Client.close(true) does not close the underlying event loop. As a result, subsequent Client.connect() calls fail with "Unable to register default event loop: Failed to add external loop. Capacity is 1 [-1]".
As far as I've investigated, the root cause is a bug inside Aerospike C client: https://github.com/aerospike/aerospike-client-c/blob/master/src/main/aerospike/as_event.c#L338. as_event_destroy_loops() is called inside if (as_event_threads_created && status){...} block, but Client.connect() calls as_event_set_external_loop_capacity(1), which in turn sets as_event_threads_created = false. As a result, as_event_destroy_loops() never gets called.
See more details here: https://discuss.aerospike.com/t/jest-sequentially-run-tests-are-failed/10307/8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions