Skip to content

Commit

Permalink
fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dobyte committed Jan 10, 2025
1 parent 20387e8 commit 693ce8a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cluster/node/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,12 @@ func (e *event) loadVersion() int32 {
// 比对版本号后进行回收对象
func (e *event) compareVersionRecycle(version int32) {
if e.version.CompareAndSwap(version, 0) {
if e.chain != nil {
e.chain.Cancel()
}

e.actor.Store((*Actor)(nil))

e.node.evtPool.Put(e)
}
}
7 changes: 7 additions & 0 deletions cluster/node/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,13 @@ func (r *request) loadVersion() int32 {
func (r *request) compareVersionRecycle(version int32) {
if r.version.CompareAndSwap(version, 0) {
r.message.Data = nil

if r.chain != nil {
r.chain.Cancel()
}

r.actor.Store((*Actor)(nil))

r.node.reqPool.Put(r)
}
}

0 comments on commit 693ce8a

Please sign in to comment.