Skip to content

Commit 81afcb3

Browse files
authored
Fix container creation taking too long (#3434)
2 parents ab97f99 + 69d7abf commit 81afcb3

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Changelog for NeoFS Node
2525

2626
### Removed
2727
- Short header support in HEAD's request and response (#3424)
28+
- Stuck missing container in SN cache after creation (#3433)
2829

2930
### Updated
3031
- `github.com/nspcc-dev/neofs-sdk-go` dependency to `v1.0.0-rc.13.0.20250623124459-a9cfab652dc0` (#3406)

cmd/neofs-node/cache.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ func newCachedContainerStorage(v container.Source, ttl time.Duration) *ttlContai
199199
}
200200
}
201201

202+
func (s *ttlContainerStorage) handleCreation(cnr cid.ID) {
203+
s.tc.remove(cnr)
204+
}
205+
202206
func (s *ttlContainerStorage) handleRemoval(cnr cid.ID) {
203207
s.tc.set(cnr, sdkcontainer.Container{}, apistatus.ContainerNotFound{})
204208
}

cmd/neofs-node/container.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ func initContainerService(c *cfg) {
6767
}
6868
c.log.Info("caught container creation, updating cache...", zap.Stringer("id", id), zap.Stringer("owner", owner))
6969
c.containerListCache.update(owner, id, true)
70+
c.containerCache.handleCreation(id)
71+
c.log.Info("successfully updated cache for the created container", zap.Stringer("id", id))
7072
})
7173

7274
subscribeToContainerRemoval(c, func(id cid.ID, owner user.ID) {

0 commit comments

Comments
 (0)