poorbarcode opened a new pull request, #17528:
URL: https://github.com/apache/pulsar/pull/17528
### Motivation
Now both Topic statuses (`fenced` and `isClosingOrDeleting`) is modified in
the following methods:
- `fenceTopicToCloseOrDelete`: set both states to `true`
- `unfenceTopicToResume`: set both states to `false`
All calls to the `fenceTopicToCloseOrDelete` has holds the lock
`persistentTopic.lock`, but when calling `unfenceTopicToResume`, maybe not
holds the lock `persistentTopic.lock`. So this could happen:
| call `fenceTopicToCloseOrDelete` | call `unfenceTopicToResume` |
| ----------- | ----------- |
| | set `isFenced` to `false` |
| set `isClosingOrDeleting` to `true` | |
| set `isFenced` to `true` | |
| | set `isClosingOrDeleting` to `false` |
After the above process is complete, the two states are not consistent.
### Modifications
Causes `unfenceTopicToResume` to execute inside a locked block.
### Documentation
- [ ] `doc-required`
- [x] `doc-not-needed`
- [ ] `doc`
- [ ] `doc-complete`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]