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

omero.client.createSession(String, String) retry logging does not provide the reason for failed connection #122

Open
aherbert opened this issue Feb 10, 2022 · 0 comments

Comments

@aherbert
Copy link

I have a connection issue with OMERO Insight but the logging outputs a non-helpful message.

The message logged to the console during the Insight's retry attempts is:

> omero-insight                                                                                                                        
-! 10/02/2022 14:27:33:914 warning: Initializer: null - createSession retry: 1                                                       
-! 10/02/2022 14:27:38:928 warning: Initializer: null - createSession retry: 2 

The null in this message can be traced to logging in omero-blitz omero.client on line 803.

The null is meant to be a reason that is set in the catch block handling the exception. However the reason variable is declared inside the retry loop while loop. Thus is always null when the retry reason is logged.

See omero.client Line 801

If you move this declaration outside the while loop:

        int retries = 0;
        String reason = null;
        while (retries < 3) {

Then the logged message will be useful.

Note that if the Glacier2.SessionPrx prx ends up being null after the failed connection attempts, the last recorded reason can then also be thrown in the line:

        if (null == prx) {
            // TODO: Add 'reason' to this error if not null
            throw new ClientError("Obtained null object proxy");
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant