Skip to content

Fix/discrete log async#131

Merged
keithrfung merged 2 commits intomainfrom
fix/discrete_log_async
Aug 5, 2020
Merged

Fix/discrete log async#131
keithrfung merged 2 commits intomainfrom
fix/discrete_log_async

Conversation

@danwallach
Copy link
Copy Markdown
Collaborator

Issue

Fixes #130

Description

I'm working on getting EG to work with ray.io, a cluster computing framework. I ran into one issue with async code in dlog.py. The gist of it is that the call to initialize __dlog_lock was failing, and I was getting an error about a missing "event loop". Turns out, the way Ray was running the code was tickling this issue.

The solution is really straightforward: delay initialization of the lock variable until you're inside __discrete_log_internal.

Testing

The existing test suite still works fine.

Checklist

🚨Please review the guidelines for contributing to this repository.

  • 🤔 CONSIDER adding a unit test if your PR resolves an issue.
  • DO check open PR's to avoid duplicates.
  • DO keep pull requests small so they can be easily reviewed.
  • DO build locally before pushing.
  • DO make sure tests pass.
  • DO make sure any new changes are documented.
  • DO make sure not to introduce any compiler warnings.
  • AVOID breaking the continuous integration build.
  • AVOID making significant changes to the overall architecture.

💚Thank you!

@danwallach
Copy link
Copy Markdown
Collaborator Author

Need to rebase this before merge. The change here is way too big.

@danwallach danwallach force-pushed the fix/discrete_log_async branch from c4e9234 to a565e1e Compare August 3, 2020 15:42
@danwallach
Copy link
Copy Markdown
Collaborator Author

Okay, rebase successful. The PR now only touches dlog.py.

Comment thread src/electionguard/dlog.py Outdated
Comment thread src/electionguard/dlog.py Outdated
@keithrfung keithrfung marked this pull request as ready for review August 4, 2020 16:40
@keithrfung keithrfung self-requested a review August 4, 2020 16:40
Copy link
Copy Markdown
Contributor

@keithrfung keithrfung left a comment

Choose a reason for hiding this comment

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

Changed this to ready for review and left comments since this seemed as if the changes were already implemented.

Comment thread src/electionguard/dlog.py
@AddressXception
Copy link
Copy Markdown
Contributor

modified the comment lines to be more concise in code, and moved the description into the PR. Everything is ready to go

@keithrfung keithrfung self-requested a review August 5, 2020 15:45
@keithrfung keithrfung merged commit 0150373 into main Aug 5, 2020
@keithrfung keithrfung deleted the fix/discrete_log_async branch August 5, 2020 16:19
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.

discrete_log initialization doesn't work if there isn't an "event loop"

3 participants