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

Null session ID in registration/subscription meta events when callee/subscriber leaves #2084

Open
ecorm opened this issue Jun 16, 2023 · 2 comments

Comments

@ecorm
Copy link

ecorm commented Jun 16, 2023

When a callee leaves, the wamp.registration.on_unregister meta event that is emitted contains a null session id argument instead of an expected integer. The same thing happens with the wamp.registration.on_delete meta event.

The same goes for a subscriber leaving. When a subscriber leaves, the wamp.subscription.on_subscribe meta event that is emitted contains a null session id argument instead of an expected integer. The same thing happens with the wamp.subscription.on_delete meta event.

Is the null session ID intentional is these cases, due to callee/subscriber session no longer existing? The WAMP spec lists session|id as the first positional argument, and does not mention anything about it being nullable.

This is with Crossbar v.23.1.2.

@oberstet
Copy link
Contributor

oberstet commented Jun 17, 2023

The WAMP spec lists session|id as the first positional argument, and does not mention anything about it being nullable.

yes, the session_id must be filled (not null). and this should be filled for both these cases:

  1. subscriber explicitly unsubscribes while the session itself remains open
  2. subscriber session leaves - deliberately or otherwise - and the subscription ends implicitly because the subscribed session is gone

that means: if crossbar doesn't fill it, that's a bug.

here is the sequence of code that I think is run.

the ID is fetched from session._session_id where session is a crossbar.router.session.RouterSession

https://github.com/crossbario/crossbar/blob/03d7057ee18a0d1e59b33bf1633ee246c1cf908a/crossbar/router/session.py#LL390C7-L390C20

the 2 cases above are exactly here

oberstet@intel-nuci7:~$ find scm/crossbario/crossbar/crossbar -name "*.py" -exec grep -Hin "on_unregister" {} \;
scm/crossbario/crossbar/crossbar/router/dealer.py:257:                                'wamp.registration.on_unregister',
scm/crossbario/crossbar/crossbar/router/dealer.py:660:                    service_session.publish('wamp.registration.on_unregister',
  1. crossbar.router.Dealer._unregister

service_session.publish('wamp.registration.on_unregister',

  1. crossbar.router.Dealer.detach

'wamp.registration.on_unregister',


not sure what might go wrong ... thing is, there are only a couple of places where _session_id is set None:

oberstet@intel-nuci7:~$ find scm/crossbario/crossbar/crossbar -name "*.py" -exec grep -Hin "\._session_id = None" {} \;

scm/crossbario/crossbar/crossbar/worker/proxy.py:121:        self._session_id = None
scm/crossbario/crossbar/crossbar/router/session.py:436:        self._session_id = None
scm/crossbario/crossbar/crossbar/router/session.py:637:                self._session_id = None
scm/crossbario/crossbar/crossbar/router/session.py:685:                self._session_id = None
scm/crossbario/crossbar/crossbar/router/session.py:746:            self._session_id = None
scm/crossbario/crossbar/crossbar/router/session.py:791:        self._session_id = None

@ecorm
Copy link
Author

ecorm commented Jun 17, 2023

I've seen those nulls in the raw JSON message dumps while I was debugging, so I'm very confident it's not a problem on my end.

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

2 participants