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

[WPB-10308] Use RabbitMQ queues for notifications #4272

Merged

Conversation

battermann
Copy link
Contributor

@battermann battermann commented Sep 26, 2024

This is not to be merged before we make a release 5.6 per https://wearezeta.atlassian.net/browse/WPB-11239. The release happened on Oct 31, 2024: https://github.com/wireapp/wire-server/releases/tag/v2024-10-30

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines
  • find error, undefined, TODO, and fix them
  • brig currently loads a conn into Env and keeps it even after it dies. we should load an MVar into the env and replace broken chans in a top-level loop (like the old delete users queue in brig). (this point was based on a misunderstanding.)

@echoes-hq echoes-hq bot added the echoes/initiative: scale Enterprise Readiness Initiatives label Sep 26, 2024
@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Sep 26, 2024
@battermann battermann changed the title WPB-10308 Use RabbitMQ queues for notifications [WPB-10308] Use RabbitMQ queues for notifications Sep 26, 2024
@akshaymankar akshaymankar force-pushed the WPB-10308-use-rabbti-mq-classic-queues-for-notifications branch 3 times, most recently from 842158f to 2974f24 Compare October 2, 2024 06:50
@fisx fisx force-pushed the WPB-10308-use-rabbti-mq-classic-queues-for-notifications branch from 3321d48 to 861ee10 Compare October 7, 2024 20:27
Comment on lines 122 to 123
stableRabbitmqConn :: Cannon (MVar (Maybe Connection))
stableRabbitmqConn = Cannon $ asks stableRabbitmqConn_
Copy link
Member

Choose a reason for hiding this comment

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

There is a limit on number of channels we can open per connection, so this solution will likely break because of that. I think it might be best to go back to separate connections per client for now because of two reasons:

  • I think I misjudged that openning ~20k connections will break rabbitmq, perhaps we just need to run many nodes.
  • For this we should probably implement some smart connection pooling, which would take some time and look very different from this, so perhaps we can split this work up like that.

@akshaymankar akshaymankar force-pushed the WPB-10308-use-rabbti-mq-classic-queues-for-notifications branch 2 times, most recently from 9c4421e to 0fc2e4e Compare October 9, 2024 14:22
akshaymankar added a commit that referenced this pull request Oct 9, 2024
It has been set to `true` for a few years now and seems to work well. It is
being removed to reduce work for RabbitMq based notifications.

Related: #4272
Also: https://wearezeta.atlassian.net/browse/WPB-10308
akshaymankar added a commit that referenced this pull request Oct 10, 2024
It has been set to `true` for a few years now and seems to work well. It is
being removed to reduce work for RabbitMq based notifications.

Related: #4272
Also: https://wearezeta.atlassian.net/browse/WPB-10308
akshaymankar added a commit that referenced this pull request Oct 10, 2024
It has been set to `true` for a few years now and seems to work well. It is
being removed to reduce work for RabbitMq based notifications.

Related: #4272
Also: https://wearezeta.atlassian.net/browse/WPB-10308
@akshaymankar akshaymankar force-pushed the WPB-10308-use-rabbti-mq-classic-queues-for-notifications branch from 3a2c797 to 1f0792d Compare October 10, 2024 07:07
@akshaymankar akshaymankar force-pushed the WPB-10308-use-rabbti-mq-classic-queues-for-notifications branch from b9355f2 to c87d7b0 Compare October 21, 2024 08:10
Notifications are now also send via RabbitMQ therefore RabbitMQ is now a required configuration in brig.
Notifications are now also sent via RabbitMQ therefore RabbitMQ is now a required configuration in brig.
Copy link
Member

Choose a reason for hiding this comment

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

This is not true, brig shouldn't require rabbitmq unless federation is enabled.

Copy link
Contributor

Choose a reason for hiding this comment

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

I've updated the change log to fix the statement.

Comment on lines +274 to +275
unless isAckChanEmpty $ do
putStrLn $ colored yellow $ "The ack chan is not empty after 50ms, some acks may not make it to the server"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this to stay in the test?

Comment on lines +279 to +282
timeout 1_000_000 (wait wsThread) >>= \case
Nothing ->
putStrLn $ colored yellow $ "The websocket thread did not close after waiting for 1s"
Just () -> pure ()
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this to stay in the test?

Comment on lines +201 to +211
rsingleton0 :: forall x. x -> Range 0 1 [x]
rsingleton0 = rcast . rsingleton

rnil1 :: forall x. Range 0 1 [x]
rnil1 = rcast rnil

partitionToRange :: These a b -> (Range 0 1 [a], Range 0 1 [b])
partitionToRange = \case
(This a) -> (rsingleton0 a, rnil1)
(That b) -> (rnil1, rsingleton0 b)
(These a b) -> (rsingleton0 a, rsingleton0 b)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do these belong in Data.Range?

@mdimjasevic mdimjasevic changed the title [WPB-10308] Use RabbitMQ queues for notifications [WPB-10308] [DO NOT MERGE] Use RabbitMQ queues for notifications Oct 22, 2024
@echoes-hq echoes-hq bot added the echoes: product-roadmap Work aligned with the customer-announced roadmap, targeting a specific release date. label Oct 22, 2024
@mdimjasevic mdimjasevic marked this pull request as ready for review October 22, 2024 18:53
@mdimjasevic mdimjasevic changed the title [WPB-10308] [DO NOT MERGE] Use RabbitMQ queues for notifications [WPB-10308] Use RabbitMQ queues for notifications Nov 11, 2024
@mdimjasevic mdimjasevic merged commit 93e8ca7 into develop Nov 12, 2024
10 checks passed
@mdimjasevic mdimjasevic deleted the WPB-10308-use-rabbti-mq-classic-queues-for-notifications branch November 12, 2024 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes/initiative: scale Enterprise Readiness Initiatives echoes: product-roadmap Work aligned with the customer-announced roadmap, targeting a specific release date. ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants