-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[core] Fix gcs and raylet logging for stdout #48952
[core] Fix gcs and raylet logging for stdout #48952
Conversation
Signed-off-by: hjiang <[email protected]>
Signed-off-by: hjiang <[email protected]>
79144b4
to
7c1c266
Compare
? std::numeric_limits<int64_t>::max() | ||
: FLAGS_log_rotation_size; | ||
RAY_CHECK_EQ(setenv( | ||
"RAY_ROTATION_MAX_BYTES", std::to_string(log_rotation_max_size), /*overwrite=*/1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you explain diff of RAY_ROTATION_MAX_BYTES vs FLAGS_log_rotation_size ? If we already have the former, then we only need to fix existing behavior? I see gcs_server_main.cc already call ray::RayLog::StartRayLog and why does the log rotations in it do not work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't do anything in this PR, instead only do 2 things:
- remove python stdout/stderr redirection
- change ray_log_shutdown_raii from
/*log_dir=*/""
to/*log_dir=*/FLAGS_log_dir
will the rotations automatically work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes but the file name will be changed. We want to keep the existing gcs_server.out filename for backward compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will the rotations automatically work?
To answer your question, passing the log directory works for log rotation.
But one motivation would be backward compatibility, namely keep the gcs_server.out
filename.
Signed-off-by: hjiang <[email protected]>
Signed-off-by: hjiang <[email protected]>
Signed-off-by: hjiang <[email protected]>
Signed-off-by: hjiang <[email protected]>
Signed-off-by: hjiang <[email protected]>
Now we have 2 ways to specify a RayLog storage:
and log_file has higher priority than log_dir. This setup is a bit nuanced and instead can we do something simpler like this:
so that:
|
Updated, let me know if I understand correctly. |
Signed-off-by: hjiang <[email protected]>
Signed-off-by: hjiang <[email protected]>
0410cb3
to
3ebaa57
Compare
Signed-off-by: dentiny <[email protected]>
Signed-off-by: dentiny <[email protected]>
const std::string &log_dir, | ||
const std::string &log_filepath, | ||
size_t log_rotation_max_size, | ||
size_t log_rotation_file_num) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see where it's used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't finished implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing argument is not ideal in a way, since you need to define a priority between env vs passed var.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or you can always pass in the final rotation size and calculate on the caller side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, updated.
const std::string &logDir = ""); | ||
const std::string &log_dir = "", | ||
const std::string &log_filepath = "", | ||
size_t log_rotation_max_size = kDefaultLogRotationMaxSize, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default_log_rotation_max_size
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
google coding stlye suggests constant starts with k
and CamelCase: https://google.github.io/styleguide/cppguide.html#Constant_Names
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean the parameter name. It's the default value when the env var is not set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I won't do that... otherwise you have to define a priority system for pass-ed value and env value.
Signed-off-by: dentiny <[email protected]>
Signed-off-by: dentiny <[email protected]>
Signed-off-by: dentiny <[email protected]>
Signed-off-by: dentiny <[email protected]>
Signed-off-by: dentiny <[email protected]>
Signed-off-by: dentiny <[email protected]>
Signed-off-by: dentiny <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rynewang please merge after CI passes.
Signed-off-by: dentiny <[email protected]>
Signed-off-by: dentiny <[email protected]>
Signed-off-by: dentiny <[email protected]>
…nto hjiang/gcs-service-logging
Signed-off-by: dentiny <[email protected]>
Signed-off-by: dentiny <[email protected]>
The failed unit test doesn't seem to be related to my change. |
Hi @rynewang , the CI has passed (prev failures are due to known flaky tests), could you please kindly help me review / merge this PR when you have some time? Thank you so much! |
Followup PR for #48952 This is cleans up TODO items left in prev one, which merges `log_dir` and `log_filepath` into one. --------- Signed-off-by: dentiny <[email protected]>
Followup PR for #48952 to enable worker log rotation, which I verified to work. Signed-off-by: dentiny <[email protected]>
Followup PR for #48952 This is cleans up TODO items left in prev one, which merges `log_dir` and `log_filepath` into one. --------- Signed-off-by: dentiny <[email protected]>
Followup PR for #48952 to enable worker log rotation, which I verified to work. Signed-off-by: dentiny <[email protected]>
Same motivation as #48931, but different implementation.
TLDR for the problem: