-
Notifications
You must be signed in to change notification settings - Fork 516
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
Open askar sessions only on demand - Connections #1424
Open askar sessions only on demand - Connections #1424
Conversation
Signed-off-by: Andraž Cuderman <[email protected]>
Signed-off-by: Andraž Cuderman <[email protected]>
Signed-off-by: Andraž Cuderman <[email protected]>
Signed-off-by: Andraž Cuderman <[email protected]>
Signed-off-by: Andraž Cuderman <[email protected]>
Signed-off-by: Andraž Cuderman <[email protected]>
Signed-off-by: arin.hlaj <[email protected]> Signed-off-by: Andraž Cuderman <[email protected]>
Signed-off-by: arin.hlaj <[email protected]> Signed-off-by: Andraž Cuderman <[email protected]>
Signed-off-by: Andraž Cuderman <[email protected]>
aries_cloudagent/core/in_memory.py
Outdated
@@ -49,6 +49,11 @@ def bind_providers(self): | |||
), | |||
) | |||
|
|||
def _init_context(self): |
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 don't see why this is necessary, it's already performed for the session when that is created?
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.
This is performed on the session only when test_session
function is called. But in this case we call test_profile
.
Another option would be to call init_context every time we create a new session (in constructor) but I think used approach is clearer since in non test environment, dependencies are also bound to the profile context.
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.
The session must be awaited or used as an async context manager. When this happens the _setup
method is called, which calls _init_context
on the session. If the session has not been initialized this way then it is not technically 'open' (the in-memory backend is more forgiving about this currently). I think that adding this workaround is just masking the issue.
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.
Thanks for the explanation. We removed _init_context
on the profile and created sessions with async context.
Thanks! Looks very thorough in general |
Signed-off-by: Andraž Cuderman <[email protected]>
Signed-off-by: Andraž Cuderman <[email protected]>
Signed-off-by: Andraž Cuderman <[email protected]>
Signed-off-by: Andraž Cuderman <[email protected]>
Signed-off-by: Andraž Cuderman <[email protected]>
Signed-off-by: Andraž Cuderman <[email protected]>
Signed-off-by: Andraž Cuderman <[email protected]>
Signed-off-by: Andraž Cuderman <[email protected]>
Signed-off-by: Andraž Cuderman <[email protected]>
fa9b363
to
df4e33e
Compare
This PR fixes the connections part of the #1417 issue.