-
Notifications
You must be signed in to change notification settings - Fork 9
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
Fix bug when connecting to multiple servers #86
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dominikl
reviewed
Jan 29, 2024
Thanks for your quick validation ! |
dominikl
approved these changes
Jan 29, 2024
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.
👍
Co-authored-by: jean-marie burel <[email protected]>
Co-authored-by: jean-marie burel <[email protected]>
Since 2003, this codebase has substantially grown thanks to the input of several tens of contributors. Over two decades, commits from the same author are associated with multiple variants of the author line. In order to effectively review and audit contributions, it is necessary to normalize this variant. This commit attempts to do so by using the Git mailmap functionality to associate all commits from the same individual to a single First Name Last Name <email> form. When applicable, either the University of Dundee or the Glencoe Software email address is used as the canonical address.
Co-authored-by: Dominik Lindner <[email protected]>
This pull request has been mentioned on Image.sc Forum. There might be relevant details there: https://forum.image.sc/t/omero-java-gateway-changes-between-5-9-0-and-5-9-3/105052/2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello @dominikl, @jburel
I have an unexpected behavior when I'm connecting to 2 different omero servers.
First, I'm connecting to one server (e.g
server1
) ; the gateway and context are initialized correctly. Then, I get for theAdminFacility
andBrowseFacility
instance to retreive some images and check if the current user is admin or not.Then, I'm connecting to the second server (e.g
server2
). A new gateway is initiliazed, as well as a new Security context. Everything is fine until I get theAdminFacility
. At that point, a connection error is raised, which is a bit unexpected as thegateway.connect(cred)
works fine.The cause of the connection error seems to be the hostname. When connecting to
server2
,gateway.getFacility(AdminFacility.class)
, the hostname in the attached security context isserver2
gateway.getFacility(AdminFacility.class)
, the hostname in the attached security context isserver1
It takes me quite some time to understand why the swapping is happening but I finally manage to find what causes this issue.
On this line, the requested facilities are got from the cache (which is a good thing by the way) but they are got only based on their name ; there is no information about the server from which they come from. So, by default, when I request the
AdminFacility
onserver2
, it returns me theAdminFacility
fromserver1
i.e. the first cached object.So, I just added, in the key, the hostname of the server and everything worked correctly. I also added a public method to get the hostname from the
Gateway
object.Rémy