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: deadlock in peer connector / manager interaction #837

Merged
merged 3 commits into from
Oct 26, 2023

Conversation

richard-ramos
Copy link
Member

Description

Fixes the error seen on this build:
https://ci.status.im/blue/organizations/jenkins/go-waku%2Fprs%2Frace/detail/PR-828/4/pipeline/

Changes

  • When creating a subscription to a discovery service, use the context that is provided to jump out of loop
  • When AddDiscoveredPeer is invoked, use a goroutine to call PushToChan. This is because when calling the PeerConnector Stop() function, a write lock is acquired, and PushToChan tries to acquire a read lock immediately, and then Stop() gets stuck

@status-im-auto
Copy link

status-im-auto commented Oct 25, 2023

Jenkins Builds

Click to see older builds (6)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ bfd7d56 #1 2023-10-25 20:16:32 ~1 min nix-flake 📄log
✔️ bfd7d56 #1 2023-10-25 20:17:05 ~2 min linux 📦deb
✔️ bfd7d56 #1 2023-10-25 20:18:09 ~3 min tests 📄log
✔️ bfd7d56 #1 2023-10-25 20:18:29 ~3 min tests 📄log
✔️ bfd7d56 #1 2023-10-25 20:19:19 ~4 min android 📦tgz
✔️ bfd7d56 #1 2023-10-25 20:19:38 ~5 min ios 📦tgz
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ d760931 #2 2023-10-25 20:18:15 ~1 min linux 📦deb
✔️ d760931 #2 2023-10-25 20:18:28 ~1 min nix-flake 📄log
✔️ d760931 #2 2023-10-25 20:19:49 ~4 min ios 📦tgz
✖️ d760931 #2 2023-10-25 20:20:24 ~2 min tests 📄log
✔️ d760931 #2 2023-10-25 20:21:59 ~3 min tests 📄log
✔️ d760931 #2 2023-10-25 20:22:43 ~3 min android 📦tgz
✔️ d760931 #3 2023-10-25 22:30:24 ~2 min tests 📄log
✔️ a5683c2 #3 2023-10-26 01:16:20 ~1 min linux 📦deb
✔️ a5683c2 #3 2023-10-26 01:17:02 ~1 min tests 📄log
✔️ a5683c2 #3 2023-10-26 01:17:07 ~1 min nix-flake 📄log
✔️ a5683c2 #4 2023-10-26 01:18:30 ~3 min tests 📄log
✔️ a5683c2 #3 2023-10-26 01:18:51 ~3 min android 📦tgz
✔️ a5683c2 #3 2023-10-26 01:19:13 ~4 min ios 📦tgz

Copy link
Collaborator

@chaitanyaprem chaitanyaprem left a comment

Choose a reason for hiding this comment

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

Good find.
LGTM

Copy link
Contributor

@harsh-98 harsh-98 left a comment

Choose a reason for hiding this comment

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

lgtm.

@richard-ramos richard-ramos merged commit c58d0f5 into master Oct 26, 2023
2 checks passed
@richard-ramos richard-ramos deleted the fix/race-condition branch October 26, 2023 01:25
richard-ramos added a commit to waku-org/waku-rust-bindings that referenced this pull request Oct 26, 2023
richard-ramos added a commit to waku-org/waku-rust-bindings that referenced this pull request Oct 30, 2023
richard-ramos added a commit to waku-org/waku-rust-bindings that referenced this pull request Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants