Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix log printing always shows the role as child under daemonize #1301

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

enjoy-binbin
Copy link
Member

@enjoy-binbin enjoy-binbin commented Nov 13, 2024

In #1282, we init server.pid earlier to keep log message role
consistent, but we forgot to consider daemonize. In daemonize
mode, we will always print the child role.

We need to reset server.pid after daemonize(), otherwise the
log printing role will always be the child. It also causes a
incorrect server.pid value, affecting the concatenation of
some pid names.

In valkey-io#1282, we init server.pid earlier to keep log message role
consistent, but we forgot to consider daemonize. In daemonize
mode, we will always print the child role.

We need to reset server.pid after daemonize(), otherwise the
log printing role will always be the child.

Signed-off-by: Binbin <binloveplay1314@qq.com>
Copy link
Contributor

@zuiderkwast zuiderkwast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

@azuredream FYI

Copy link

codecov bot commented Nov 13, 2024

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 70.69%. Comparing base (2df56d8) to head (0a98333).
Report is 1 commits behind head on unstable.

Files with missing lines Patch % Lines
src/server.c 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #1301   +/-   ##
=========================================
  Coverage     70.69%   70.69%           
=========================================
  Files           114      114           
  Lines         63161    63163    +2     
=========================================
+ Hits          44650    44656    +6     
+ Misses        18511    18507    -4     
Files with missing lines Coverage Δ
src/server.c 87.64% <0.00%> (-0.06%) ⬇️

... and 11 files with indirect coverage changes

@enjoy-binbin enjoy-binbin merged commit 6fba747 into valkey-io:unstable Nov 14, 2024
48 checks passed
@enjoy-binbin enjoy-binbin deleted the fix_pid branch November 14, 2024 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants