Skip to content

Commit

Permalink
Merge 1816aaa into c2918fc
Browse files Browse the repository at this point in the history
  • Loading branch information
carpawell authored Aug 4, 2022
2 parents c2918fc + 1816aaa commit abbc1d0
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cmd/neofs-node/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"log"
"os"
"os/signal"
"runtime"
"syscall"

"github.com/nspcc-dev/neofs-node/misc"
Expand Down Expand Up @@ -34,6 +35,8 @@ func fatalOnErrDetails(details string, err error) {
}

func main() {
runtime.SetBlockProfileRate(1)

configFile := flag.String("config", "", "path to config")
versionFlag := flag.Bool("version", false, "neofs node version")
flag.Parse()
Expand Down
17 changes: 17 additions & 0 deletions pkg/local_object_storage/metabase/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,23 @@ func stringCommonPrefixMatcherBucket(b *bbolt.Bucket, fKey string, fVal string,
prefix = val[:len(val)-1]
}

if len(val) == 0 {
// empty common prefix, all the objects
// satisfy that filter
err := b.ForEach(func(k, v []byte) error {
if err := f(k, v); err != nil {
return err
}

return nil
})
if err != nil {
return err
}

return nil
}

c := b.Cursor()
for k, v := c.Seek(val); bytes.HasPrefix(k, prefix); k, v = c.Next() {
if checkLast && (len(k) == len(prefix) || k[len(prefix)]>>4 != val[len(val)-1]) {
Expand Down
7 changes: 6 additions & 1 deletion pkg/morph/event/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,12 @@ loop:
continue loop
}

l.parseAndHandleNotification(notifyEvent)
if err = l.pool.Submit(func() {
l.parseAndHandleNotification(notifyEvent)
}); err != nil {
l.log.Warn("listener worker pool drained",
zap.Int("capacity", l.pool.Cap()))
}
case notaryEvent, ok := <-notaryChan:
if !ok {
l.log.Warn("stop event listener by notary channel")
Expand Down

0 comments on commit abbc1d0

Please sign in to comment.