Skip to content

Test new sync server API hanging: #383

@ayjayt

Description

@ayjayt
import atexit

import kaleido

_KALEIDO_INITIALIZED = False

def init_if_not_running():
    global _KALEIDO_INITIALIZED
    if not _KALEIDO_INITIALIZED:
        print("initializing Kaleido")
        kaleido.start_sync_server()
        _KALEIDO_INITIALIZED = True

def test():
    print("I'm being triggered")

def shutdown_kaleido(shutdown_func):
    print("shutting down kaleido")
    shutdown_func()

atexit.register(shutdown_kaleido, kaleido.stop_sync_server)
atexit.register(test)

init_if_not_running() # comment out to exit gracefully

Then later, when trying to terminate via exit() or quit or Ctrl+D, it will hang. Notably, it will not even print "I'm being triggered" from the other registered function.
But when init_if_not_running() is commented out, it successfully calls the registered functions.

Metadata

Metadata

Assignees

Labels

P1needs immediate attention

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions