-
Notifications
You must be signed in to change notification settings - Fork 26
Fix/ub 624 flex should not write log into flex driver directory #181
Fix/ub 624 flex should not write log into flex driver directory #181
Conversation
Signed-off-by: feihuang <feihuang@feihuangs-mbp.cn.ibm.com>
Signed-off-by: feihuang <feihuang@feihuangs-mbp.cn.ibm.com>
Signed-off-by: feihuang <feihuang@feihuangs-mbp.cn.ibm.com>
Review status: 0 of 3 files reviewed at latest revision, 5 unresolved discussions. utils/logs/global_logger.go, line 25 at r2 (raw file):
send to Alon the new import link please. utils/logs/global_logger.go, line 60 at r2 (raw file):
but what if the directory already exist? (you check above if the file exist but what if the file not exist but the dir exist? you suould handle it as well) utils/logs/global_logger.go, line 76 at r2 (raw file):
just do it in one line, instead of 2 lines utils/logs/global_logger.go, line 79 at r2 (raw file):
don't hardcoded in the comment the max size which is configurable. utils/logs/global_logger.go, line 83 at r2 (raw file):
what happened if 10 flex runs at the same time? Comments from Reviewable |
Review status: 0 of 3 files reviewed at latest revision, 5 unresolved discussions. utils/logs/global_logger.go, line 83 at r2 (raw file): Previously, shay-berman wrote…
Fie, did you tested it? Comments from Reviewable |
Review status: 0 of 3 files reviewed at latest revision, 5 unresolved discussions. utils/logs/global_logger.go, line 25 at r2 (raw file): Previously, shay-berman wrote…
https://github.com/natefinch/lumberjack utils/logs/global_logger.go, line 60 at r2 (raw file): Previously, shay-berman wrote…
MkdirAll will do nothing if the dir exist but file not exist, so we can ignore this utils/logs/global_logger.go, line 76 at r2 (raw file): Previously, shay-berman wrote…
changed utils/logs/global_logger.go, line 79 at r2 (raw file): Previously, shay-berman wrote…
done utils/logs/global_logger.go, line 83 at r2 (raw file): Previously, shay-berman wrote…
https://wiki.xiv.ibm.com/display/HostSide/Flex+log+file+refactor Comments from Reviewable |
…_Flex_should_not_write_log_into_flex_driver_directory
Signed-off-by: feihuang <feihuang@feihuangs-mbp.cn.ibm.com>
Review status: 0 of 4 files reviewed at latest revision, 3 unresolved discussions, some commit checks failed. utils/logs/global_logger.go, line 60 at r2 (raw file): Previously, hfeish (Fei Huang) wrote…
ok utils/logs/global_logger.go, line 83 at r2 (raw file): Previously, hfeish (Fei Huang) wrote…
whats happened if one flex rotate the file while other one write to it? Comments from Reviewable |
Review status: 0 of 5 files reviewed at latest revision, 3 unresolved discussions, some commit checks failed. utils/logs/global_logger.go, line 60 at r2 (raw file): Previously, shay-berman wrote…
Add UT in the utils/logs/global_logger_test.go utils/logs/global_logger.go, line 83 at r2 (raw file): Previously, shay-berman wrote…
When we call InitFileLogger, it will init a logger, and before that we need to compare the log file size, if it < rotatesize, it will init a logger with io.MultiWriter, and if it > rotatesize, it will init a lumberjack.logger, and this logger will rotate the log file, it will close the current logfile and renamed and a new log file created with original name. Thus the filename you give logger is always the same file name. Comments from Reviewable |
Review status: 0 of 5 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed. utils/logs/global_logger.go, line 83 at r2 (raw file): Previously, hfeish (Fei Huang) wrote…
but please make sure flex handle log rotating while other flex also do the log rotating. This is not a rare scenario. utils/logs/global_logger_test.go, line 3 at r3 (raw file):
what is this test file Comments from Reviewable |
Review status: 0 of 5 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed. utils/logs/global_logger.go, line 83 at r2 (raw file): Previously, shay-berman wrote…
I tried to attach 5 pods at same time, and it works and no error in log file, I think it meet the multi flex, right utils/logs/global_logger_test.go, line 3 at r3 (raw file): Previously, shay-berman wrote…
this is example test, dev trigger it with "go test -v", we don't need to add it into CI, because this test only prove the API works as expect just like Unit test. Comments from Reviewable |
Review status: 0 of 5 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed. utils/logs/global_logger_test.go, line 3 at r3 (raw file): Previously, hfeish (Fei Huang) wrote…
how does "go test -v" trigger this file? its not a testing or ginkgo file. What do I miss here? Comments from Reviewable |
Review status: 0 of 5 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed. utils/logs/global_logger_test.go, line 3 at r3 (raw file): Previously, shay-berman wrote…
This example test file existed, so I add a new example test in this file. Comments from Reviewable |
LGTM Review status: 0 of 5 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed. utils/logs/global_logger_test.go, line 3 at r3 (raw file): Previously, hfeish (Fei Huang) wrote…
ok so if you feel OK with this testing, then go a head and merge to dev. Comments from Reviewable |
…x_driver_directory
Need to work with Fix/ub 624 flex should not write log into flex driver director ubiquity-k8s#163
This change is