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

fix(ingest/okta): fix event_loop RuntimeError with nested asyncio #8637

Merged

Conversation

skrydal
Copy link
Contributor

@skrydal skrydal commented Aug 15, 2023

This PR addresses bug #8636. Proper fix for it depends on intended behavior of the okta connector - if nesting event loops is desired behavior then nest_asyncio should be used.

For more considerations see:
https://stackoverflow.com/questions/46827007/runtimeerror-this-event-loop-is-already-running-in-python

Fixes #8636.

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions github-actions bot added the ingestion PR or Issue related to the ingestion of metadata label Aug 15, 2023
@maggiehays maggiehays added the community-contribution PR or Issue raised by member(s) of DataHub Community label Aug 15, 2023
Copy link
Collaborator

@hsheth2 hsheth2 left a comment

Choose a reason for hiding this comment

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

This feels like a bandaid - it just seems like we're using asyncio incorrectly in this source. Technically, we shouldn't be using run_until_complete because it's blocking, and defeats the point of using asyncio in the first place (not to mention doesn't work if we don't own the event loop).

That said, using nest_asyncio is like a reasonable approach vs doing a big refactoring, so probably fine for now.

@hsheth2 hsheth2 changed the title bug(8636): Fix event_loop RuntimeError with nested asyncio fix(ingest/okta): fix event_loop RuntimeError with nested asyncio Aug 15, 2023
@hsheth2 hsheth2 added the merge-pending-ci A PR that has passed review and should be merged once CI is green. label Aug 15, 2023
@anshbansal anshbansal merged commit baae3d2 into datahub-project:master Aug 16, 2023
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-contribution PR or Issue raised by member(s) of DataHub Community ingestion PR or Issue related to the ingestion of metadata merge-pending-ci A PR that has passed review and should be merged once CI is green.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Okta ingestor fails if stateful ingestion is turned on
4 participants