HomePhabricator

Merge #14993: rpc: Fix data race (UB) in InterruptRPC()

Description

Merge #14993: rpc: Fix data race (UB) in InterruptRPC()

Summary:
Backport PR14993 . Fixes T733 .

6c10037f72073eecc674c313580ef50a4f1e1e44 rpc: Fix data race (UB) in InterruptRPC() (practicalswift)

Pull request description:

Fix data race (UB) in `InterruptRPC()`.

Before:

```
$ ./configure --with-sanitizers=thread
$ make
$ test/functional/test_runner.py feature_shutdown.py
…
SUMMARY: ThreadSanitizer: data race rpc/server.cpp:314 in InterruptRPC()
…
ALL                 | ✖ Failed  | 2 s (accumulated)
```

After:

```
$ ./configure --with-sanitizers=thread
$ make
$ test/functional/test_runner.py feature_shutdown.py
…
ALL                 | ✓ Passed  | 3 s (accumulated)
```

Test Plan: ninja check-all ; run tests with TSAN

Reviewers: Fabien, #bitcoin_abc

Reviewed By: Fabien, #bitcoin_abc

Maniphest Tasks: T733

Differential Revision: https://reviews.bitcoinabc.org/D5177