Skip to content

Commit

Permalink
version bump (#538)
Browse files Browse the repository at this point in the history
  • Loading branch information
JyotinderSingh authored Sep 11, 2024
1 parent c392d6e commit 7204ba1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion internal/eval/bitpos.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func getBitPos(byteSlice []byte, bitToFind byte, start, end int, rangeType strin
return result
}

//nolint: gocritic
// nolint: gocritic
func adjustBitPosSearchRange(start, end, byteLen int) (int, int) {
if start < 0 {
start += byteLen
Expand Down
12 changes: 4 additions & 8 deletions internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (s *AsyncServer) FindPortAndBind() (socketErr error) {
return ErrInvalidIPAddress
}

log.Infof("DiceDB running on port %d", config.Port)
log.Infof("DiceDB %s running on port %d", "0.0.3", config.Port)
return syscall.Bind(serverFD, &syscall.SockaddrInet4{
Port: config.Port,
Addr: [4]byte{ip4[0], ip4[1], ip4[2], ip4[3]},
Expand All @@ -110,7 +110,7 @@ func (s *AsyncServer) ClosePort() {
if err := syscall.Close(s.serverFD); err != nil {
log.Warn("failed to close server socket", "error", err)
} else {
log.Info("Server socket closed successfully")
log.Debug("Server socket closed successfully")
}
s.serverFD = 0
}
Expand All @@ -130,7 +130,6 @@ func (s *AsyncServer) InitiateShutdown() {
}
delete(s.connectedClients, fd)
}
log.Info("cleaned up all client connections")
}

// Run starts the server, accepts connections, and handles client requests
Expand Down Expand Up @@ -226,12 +225,9 @@ func (s *AsyncServer) eventLoop(ctx context.Context) error {
} else {
if err := s.handleClientEvent(event); err != nil {
if errors.Is(err, ErrAborted) {
log.Info("Received abort command, initiating graceful shutdown")
log.Debug("Received abort command, initiating graceful shutdown")
return err
} else if errors.Is(err, syscall.ECONNRESET) || errors.Is(err, net.ErrClosed) {
// Both are normal scenarios when client disconnections happen, hence just info log
log.Info("Connection closed by client or reset", "fd", event.Fd)
} else {
} else if !errors.Is(err, syscall.ECONNRESET) && !errors.Is(err, net.ErrClosed) {
log.Warn(err)
}
}
Expand Down
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@ func main() {
// Handling different server errors
if err != nil {
if errors.Is(err, context.Canceled) {
log.Info("Server was canceled")
log.Debug("Server was canceled")
} else if errors.Is(err, server.ErrAborted) {
log.Info("Server received abort command")
log.Debug("Server received abort command")
} else {
log.Error("Server error", "error", err)
}
} else {
log.Info("Server stopped without error")
log.Debug("Server stopped without error")
}

close(sigs)
wg.Wait()
log.Info("Server has shut down gracefully")
log.Debug("Server has shut down gracefully")
}

0 comments on commit 7204ba1

Please sign in to comment.