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

[FDS-2373] Remove the need to do version checking on Synapse creation #1495

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

BryanFauble
Copy link
Collaborator

Problem:

  1. As a part of the changes in [FDS-2373] Update jwt verification #1493 I added the creation of a new Synapse instance in the JWT verification code. During init it calls and does a version check and a redirect check. This error showed up in an integration test:
.venv/lib/python3.9/site-packages/connexion/security/security_handler_factory.py:113: in get_bearerinfo_func
    return cls._get_function(security_definition, "x-bearerInfoFunc", 'BEARERINFO_FUNC')
.venv/lib/python3.9/site-packages/connexion/security/security_handler_factory.py:50: in _get_function
    return get_function_from_name(func)
.venv/lib/python3.9/site-packages/connexion/utils.py:116: in get_function_from_name
    module = importlib.import_module(module_name)
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
schematic_api/api/security_controller.py:12: in <module>
    syn = Synapse(
.venv/lib/python3.9/site-packages/synapseclient/client.py:386: in __init__
    self.setEndpoints(
.venv/lib/python3.9/site-packages/synapseclient/client.py:699: in setEndpoints
    response = self._requests_session.get(
.venv/lib/python3.9/site-packages/requests/sessions.py:602: in get
    return self.request("GET", url, **kwargs)
.venv/lib/python3.9/site-packages/requests/sessions.py:589: in request
    resp = self.send(prep, **send_kwargs)
.venv/lib/python3.9/site-packages/requests/sessions.py:703: in send
    r = adapter.send(request, **kwargs)
.venv/lib/python3.9/site-packages/requests/adapters.py:682: in send
    raise ConnectionError(err, request=request)
E   requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

Solution:

  1. Stop the version check on creation of the Synapse instance. In addition I'll also be making a change to Synapse to wrap this in our standard retry logic too.

Copy link
Member

@thomasyu888 thomasyu888 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 LGTM!

@thomasyu888
Copy link
Member

was the integration test not run on the other PR?

@BryanFauble
Copy link
Collaborator Author

was the integration test not run on the other PR?

It was - However, I guess this can be flakey. I will be making a change to add this to the synpy retry function - It is not currently in the retry function.

Copy link

@danlu1 danlu1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

sonarqubecloud bot commented Sep 6, 2024

@BryanFauble BryanFauble merged commit 9aea09e into develop Sep 6, 2024
7 checks passed
@BryanFauble BryanFauble deleted the fds-2373-skip-check-on-instance-creation branch September 6, 2024 21:18
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

Successfully merging this pull request may close these issues.

3 participants