Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

component._stopping attribute never cleared #1613

Open
ninousf opened this issue Mar 3, 2023 · 6 comments
Open

component._stopping attribute never cleared #1613

ninousf opened this issue Mar 3, 2023 · 6 comments

Comments

@ninousf
Copy link

ninousf commented Mar 3, 2023

when calling component.stop(), _stopping attribute is set to True but it is never cleared (False value)

@oberstet
Copy link
Contributor

oberstet commented Mar 4, 2023

yes indeed: the attribute is initially set here

self._stopping = False

and before stopping starts it is set here

self._stopping = True

but it isn't reset once the stopping has finished (the component session left)

@oberstet
Copy link
Contributor

oberstet commented Mar 4, 2023

I should note that even if the attribute would be reset correctly, you can't start the component again anyways, so the component object is for the bin, and the value of the attribute of a finished component is questionable .. in a way

@ninousf
Copy link
Author

ninousf commented Mar 4, 2023

Why i can not restart a component ?
That's what i do in my code and it seems to work or i missed something

@oberstet
Copy link
Contributor

oberstet commented Mar 4, 2023

Why i can not restart a component ?

as far as I see, there is no public API to restart

That's what i do in my code and it seems to work or i missed something

@meejah any hints from you side, is component supposed to be restartable? if so, how?

@ninousf
Copy link
Author

ninousf commented Mar 4, 2023

True, it is not a plublic API

    joined = asyncio.Event()

    @comp.on_join
    def _(session, details):
        comp.session = session
        joined.set()

    loop = asyncio.get_event_loop()
    run_cb = autobahn.wamp.component._run(loop, comp)
    await joined.wait()

For me it is useful when you registered plenty of services but you just want disconnect/connect a component

@meejah
Copy link
Contributor

meejah commented Mar 6, 2023

It's been a while since I've thought about Component ;) but I don't believe I considered re-starting.

The "state-machine" of Component is basically a one-way trip towards "done" currently .. although because clients have to allow the possibility of re-connect, it could certainly be possible to make "done -> start" a valid thing to do.

I'm not clear on the use-case: is it just to dis/re-connect? Or I guess, what does "re-starting" a component mean exactly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants