-
Notifications
You must be signed in to change notification settings - Fork 601
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18498 from ztlpn/v23.2.x-bp
[v23.2.x] Fix some concurrent memory access problems in partition balancer
- Loading branch information
Showing
5 changed files
with
94 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright 2024 Redpanda Data, Inc. | ||
* | ||
* Use of this software is governed by the Business Source License | ||
* included in the file licenses/BSL.md | ||
* | ||
* As of the Change Date specified in that file, in accordance with | ||
* the Business Source License, use of this software will be governed | ||
* by the Apache License, Version 2.0 | ||
*/ | ||
#pragma once | ||
|
||
#include "seastarx.h" | ||
|
||
#include <seastar/core/sstring.hh> | ||
|
||
#include <stdexcept> | ||
|
||
/// Some objects reference state that changes comparatively rarely (e.g. | ||
/// topic_table state) across yield points and expect these references to remain | ||
/// valid. In case these references are invalidated by a concurrent fiber, this | ||
/// exception is thrown. This is a signal for the caller to restart the | ||
/// computation with up-to-date state. | ||
class concurrent_modification_error : public std::exception { | ||
public: | ||
explicit concurrent_modification_error(ss::sstring s) | ||
: _msg(std::move(s)) {} | ||
|
||
const char* what() const noexcept override { return _msg.c_str(); } | ||
|
||
private: | ||
ss::sstring _msg; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters