-
Notifications
You must be signed in to change notification settings - Fork 366
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
Add server-side session watchdog #1655
Conversation
asyncua/server/internal_session.py
Outdated
@@ -59,13 +67,44 @@ async def get_endpoints(self, params=None, sockname=None): | |||
def is_activated(self) -> bool: | |||
return self.state == SessionState.Activated | |||
|
|||
def update_last_action_time(func): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand what you want to do, but I have bad experience with that kind of decorators. they make stack trace a mess and completlu breaks typing checks. if we want t omerge that we at least need typing and check things with mypy (which probbaly only does not complain because since you do not have typing on decorator so it disabled itself)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe it is better to update some timestamp at lower level when we receive a request which is dispatched to thata internal session. IS that possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, I moved it into the UA processor
As discussed here, to comply with section 5.6.2 of the spec, the server should close a session that is inactive within its session timeout:
I no longer think this will actually resolve anything in #116, but I think it's useful nonetheless if we want to comply with the spec.