dice
dice copied to clipboard
BUG: Incorrect logging when default port is already in use
Description:
When the default port (7379) is already in use and the DiceDB server is started, a success message is incorrectly logged showing DiceDB 0.0.3 running on port 7379 before displaying the error: Error finding and binding port: address already in use
Steps to reproduce
- Start a service or process that uses port
7379 - Start DiceDB server with the default port
7379 - Observe the logs.
Expected output
The success message indicating that DiceDB is running should only be logged after the server has successfully bound to the port and started. If the port is already in use, no success message should be logged.
Observed output
The success message DiceDB 0.0.3 running on port 7379 is logged before attempting to bind the port. This causes confusion as the server immediately follows with an error message:
Error finding and binding port: address already in use
Expectations for resolution
The issue seems to stem from the success message being logged before the server attempts to bind the port and start. This message should be moved to a point after the successful binding and startup of the server.