mirror of
https://github.com/rqlite/rqlite.git
synced 2026-01-24 20:06:23 +00:00
Log cancelled Snapshot Store LockingSinks
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
### Implementation changes and bug fixes
|
||||
- [PR #2419](https://github.com/rqlite/rqlite/pull/2419): Improve MSRW Error structure.
|
||||
- [PR #2420](https://github.com/rqlite/rqlite/pull/2420): Snapshot Sink sets owner when taking MSRW.
|
||||
- [PR #2421](https://github.com/rqlite/rqlite/pull/2421): Log cancelled Snapshot Store LockingSinks.
|
||||
|
||||
## v9.3.7 (January 2nd 2026)
|
||||
### Implementation changes and bug fixes
|
||||
|
||||
@@ -64,6 +64,7 @@ type LockingSink struct {
|
||||
|
||||
mu sync.Mutex
|
||||
closed bool
|
||||
logger *log.Logger
|
||||
}
|
||||
|
||||
// NewLockingSink returns a new LockingSink.
|
||||
@@ -71,6 +72,7 @@ func NewLockingSink(sink raft.SnapshotSink, str *Store) *LockingSink {
|
||||
return &LockingSink{
|
||||
SnapshotSink: sink,
|
||||
str: str,
|
||||
logger: log.New(os.Stderr, "[snapshot-locking-sink] ", log.LstdFlags),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,6 +90,9 @@ func (s *LockingSink) Close() error {
|
||||
|
||||
// Cancel cancels the sink, unlocking the Store for creation of a new sink.
|
||||
func (s *LockingSink) Cancel() error {
|
||||
defer func() {
|
||||
s.logger.Printf("sink %s canceled", s.ID())
|
||||
}()
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
if s.closed {
|
||||
|
||||
Reference in New Issue
Block a user