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: change mutex to rwLock and fix relay unsubscribe #749

Merged
merged 4 commits into from
Sep 18, 2023

Conversation

chaitanyaprem
Copy link
Collaborator

@chaitanyaprem chaitanyaprem commented Sep 18, 2023

Description

While going through relay code, noticed that topicMutex could be made rwMutex. Unsubscribing from a topic flow is not protected by this mutex which could cause data race.

Changes

  • Changed topicMutex to RWMutex
  • Protecting subscriptionsMap and topicsMap during usubscribe.
  • Added few tests to cover unsubscribe and other relay functions

Tests

Ran all tests with and without race flag.

@status-im-auto
Copy link

status-im-auto commented Sep 18, 2023

Jenkins Builds

Click to see older builds (12)
Commit #️⃣ Finished (UTC) Duration Platform Result
✖️ 982848c #1 2023-09-18 05:22:01 ~18 sec nix-flake 📄log
✔️ 982848c #1 2023-09-18 05:24:05 ~2 min linux 📦deb
✔️ 982848c #1 2023-09-18 05:24:37 ~2 min tests 📄log
✔️ 982848c #1 2023-09-18 05:24:49 ~3 min tests 📄log
✔️ 982848c #1 2023-09-18 05:25:27 ~3 min android 📦tgz
✔️ 982848c #1 2023-09-18 05:26:37 ~4 min ios 📦tgz
✖️ 5d32705 #2 2023-09-18 06:57:52 ~17 sec nix-flake 📄log
✔️ 5d32705 #2 2023-09-18 06:58:33 ~59 sec linux 📦deb
✔️ 5d32705 #2 2023-09-18 07:00:27 ~2 min tests 📄log
✔️ 5d32705 #2 2023-09-18 07:00:35 ~2 min tests 📄log
✔️ 5d32705 #2 2023-09-18 07:01:17 ~3 min ios 📦tgz
✔️ 5d32705 #2 2023-09-18 07:01:19 ~3 min android 📦tgz
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 5218438 #3 2023-09-18 08:38:19 ~1 min linux 📦deb
✔️ 5218438 #3 2023-09-18 08:38:31 ~1 min tests 📄log
✔️ 5218438 #3 2023-09-18 08:39:02 ~1 min tests 📄log
✔️ 5218438 #3 2023-09-18 08:39:14 ~2 min nix-flake 📄log
✔️ 5218438 #3 2023-09-18 08:40:23 ~3 min android 📦tgz
✔️ 5218438 #3 2023-09-18 08:41:30 ~4 min ios 📦tgz
✔️ 9fef06a #4 2023-09-18 11:56:01 ~5 min tests 📄log
✔️ 9fef06a #4 2023-09-18 11:56:22 ~5 min linux 📦deb
✔️ 9fef06a #4 2023-09-18 11:56:25 ~5 min nix-flake 📄log
✔️ 9fef06a #4 2023-09-18 11:58:00 ~7 min android 📦tgz
✔️ 9fef06a #4 2023-09-18 11:58:01 ~7 min tests 📄log
✔️ 9fef06a #4 2023-09-18 12:02:39 ~11 min ios 📦tgz

@chaitanyaprem chaitanyaprem merged commit dd5dc7a into master Sep 18, 2023
2 checks passed
@chaitanyaprem chaitanyaprem deleted the fix/relay-topic-mutex branch September 18, 2023 13:18
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