mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 18:35:46 +02:00
chore: allow calling Context::ReportError from I/O dispatch fiber (#3182)
Fixes the issue when we are trying to Report the error from JournalStreamer::OnCompletion
that is called from a proactor callback directly from the I/O fiber.
We can not use fiber mutexes in the I/O fiber so we switch to regular mutex and reduce its critical sections
as much as possible.
Should fix the following failure:
2628431732 (step)
:6:622
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
parent
8d82581c96
commit
e6a9e0dbc2
3 changed files with 24 additions and 12 deletions
|
@ -279,12 +279,12 @@ class Context : protected Cancellation {
|
|||
// Report error.
|
||||
GenericError ReportErrorInternal(GenericError&& err);
|
||||
|
||||
private:
|
||||
GenericError err_;
|
||||
mutable util::fb2::Mutex mu_;
|
||||
|
||||
ErrHandler err_handler_;
|
||||
util::fb2::Fiber err_handler_fb_;
|
||||
|
||||
// We use regular mutexes to be able to call ReportError directly from I/O callbacks.
|
||||
mutable std::mutex err_mu_; // protects err_ and err_handler_
|
||||
};
|
||||
|
||||
struct ScanOpts {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue