HomePhabricator
Diffusion Comm 67bce29fb975

[Tunnelbroker] close RabbitMQ queue when client disconnects

Description

[Tunnelbroker] close RabbitMQ queue when client disconnects

Summary:
This might cause issues and was causing error in past:

  1. We run persistence test
  2. Queue is created, but never closed
  3. We run tests again, messages are in database, but are also put into RabbitMQ
  4. Consumer receives messages, and try to send but socket is closed at this time
  5. It generates error in Tunnelbroker logs

Depends on D9316

Test Plan:

  1. Without this changes run:

cd services/commtest && cargo test --test tunnelbroker_persist_tests  -- --nocapture

  1. Wait for the test to finish
  2. Go to RabbitMQ console and it shows queues:

Screenshot 2023-09-28 at 15.28.20.png (236×1 px, 23 KB)

  1. Restart RabbitMQ
  2. Do steps 1, 2, 3 and the console should show 0 queues:

Screenshot 2023-09-28 at 15.40.04.png (248×1 px, 25 KB)

Reviewers: michal, bartek, varun, jon

Reviewed By: michal, bartek

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D9317

Details

Provenance
kamilAuthored on Sep 28 2023, 6:46 AM
Reviewer
michal
Differential Revision
D9317: [Tunnelbroker] close RabbitMQ queue when client disconnects
Parents
rCOMM357528de9ac3: [Tunnelbroker] always persist WebSocket messages in database
Branches
Unknown
Tags
Unknown