(PXP-9503): Fix @maybe_sync decorator so that it honors synchronous clients #45
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.
Jira Ticket: PXP-9503
Although access token polling runs at the top level with asyncio, the portion of the code syncing authz information to Arborist imports the synchronous gen3authz client and does not await the gen3authz methods used. Because gen3authz's
@maybe_syncdecorator infers whether a method should be synchronous vs asynchronous based on whether sniffio finds an asynchronous library, the result is that when running access token polling, the Fence sync code thinks it is calling a synchronous gen3authz method while gen3authz thinks the method being called is an async function. This means that access token polling fails to sync authz information to Arborist.Logs are in the ticket.
Bug Fixes
@maybe_syncdecorator so that it honors synchronous clients