-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
[SPARK-21372] spark writes one log file even I set the number of spark_rotate_log to 0 #18599
Conversation
…k_rotate_log to 0
Can one of the admins verify this patch? |
Did you see any failure in production environment caused by this issue? |
@@ -78,6 +78,12 @@ spark_rotate_log () | |||
if [ -n "$2" ]; then | |||
num=$2 | |||
fi | |||
|
|||
expr $num + 0 &>/dev/null | |||
if [ $? -ne 0 ] || [ $num -eq 0 ]; then |
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.
Are you trying to verify if num
is a number? I get it but you would already get a bash
error in $num -eq 0
if so and we don't otherwise validate script input that way. Isn't this forcing num to be nonzero, when I thought the issue was handling the case of 0 correctly?
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.
@srowen
Yes, we should avoid this scenario that num isn't number.If num isn't a number,num will be set to 5.
@jiangxb1987 |
AFAIK the function |
@jiangxb1987 |
@liu-zhaokun I don't understand what bug you are referring to. We'd need to understand how an unmodified script displays some incorrect behavior. |
@srowen |
How would you set this with normal operation? |
@@ -78,6 +78,12 @@ spark_rotate_log () | |||
if [ -n "$2" ]; then | |||
num=$2 |
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.
@srowen
There provide a param,num, to set the number of logfile,but it wasn't used in line 179.Since it doesn't work,can I remove the param "num" and use it just as a variable?
@srowen |
Let's close this. You aren't providing a scenario where an input causes a problem, and I think are still saying the error happens when you modify the script. |
@srowen |
https://issues.apache.org/jira/browse/SPARK-21372
Spark writes one log file even I set the number of spark_rotate_log to 0.Meanwhile,the number of spark_rotate_log also can set to a string type and other type.So I think we should make some changes.