-
Notifications
You must be signed in to change notification settings - Fork 26
Added a timeout for an execute call, and a timeout for sg_inq. + unit… #166
Conversation
Review status: 0 of 4 files reviewed at latest revision, 3 unresolved discussions, some commit checks failed. utils/executor.go, line 74 at r1 (raw file):
maybe its better to get it in seconds(i don't see us playing with miliseconds, so one line below instead of *time.Millisecond you should use *time.Second utils/executor.go, line 80 at r1 (raw file):
i didn't find a way to kill it with sigKill(-9) utils/executor.go, line 86 at r1 (raw file):
Please add before this line
and please add more logs to the logs.Args as follow: Comments from Reviewable |
Review status: 0 of 4 files reviewed at latest revision, 5 unresolved discussions, some commit checks failed. remote/mounter/block_device_utils/mpath.go, line 168 at r1 (raw file):
1000 msec is only 1 second, I thing its too short. change it to 5 seconds(5000) utils/executor.go, line 95 at r1 (raw file):
BTW i am not sure if we reach to timeout, is the Run() return error if timeout exceeded? because if not there you have a bug here, so u need to return a specific error lets say with timeout_message Comments from Reviewable |
Review status: 0 of 4 files reviewed at latest revision, 5 unresolved discussions, some commit checks failed. utils/executor.go, line 74 at r1 (raw file): Previously, shay-berman wrote…
I disagree, this is a better granularity, we might reduct the timeout to less then a second in the future and also in other future reuses of this class. utils/executor.go, line 86 at r1 (raw file): Previously, shay-berman wrote…
I think that the proper way to do it as I found in the docs is using select: select { Comments from Reviewable |
Review status: 0 of 4 files reviewed at latest revision, 5 unresolved discussions, some commit checks failed. utils/executor.go, line 95 at r1 (raw file): Previously, shay-berman wrote…
Shay please look at https://golang.org/pkg/os/exec/#CommandContext Comments from Reviewable |
Review status: 0 of 4 files reviewed at latest revision, 5 unresolved discussions, some commit checks failed. utils/executor.go, line 80 at r1 (raw file): Previously, shay-berman wrote…
it is using kill https://golang.org/pkg/os/#Process.Kill not signal Comments from Reviewable |
Review status: 0 of 4 files reviewed at latest revision, 5 unresolved discussions, some commit checks failed. remote/mounter/block_device_utils/mpath.go, line 168 at r1 (raw file): Previously, shay-berman wrote…
sg_inq returns quickly if the device is attached. I guess you are afraid of iSCSI latencies? Maybe we can extend it to 2-3 seconds? Comments from Reviewable |
utils/executor.go, line 86 at r1 (raw file): Previously, ranhrl (Ran Harel) wrote…
My mistake, just ignore this one Comments from Reviewable |
Review status: 0 of 4 files reviewed at latest revision, 5 unresolved discussions, some commit checks failed. Comments from Reviewable |
Reviewed 4 of 4 files at r1. Comments from Reviewable |
Review status: all files reviewed at latest revision, 6 unresolved discussions, some commit checks failed. remote/mounter/block_device_utils/mpath.go, line 168 at r1 (raw file): Previously, ranhrl (Ran Harel) wrote…
ok so the average is 4 seconds :-) utils/executor.go, line 80 at r1 (raw file): Previously, ranhrl (Ran Harel) wrote…
below it send signal to the process utils/executor.go, line 86 at r1 (raw file): Previously, ranhrl (Ran Harel) wrote…
I saw this select option, its alternative, but no need to do it. utils/executor.go, line 92 at r1 (raw file):
I see that we are not printing the error of the Run command, its not good. utils/executor.go, line 95 at r1 (raw file): Previously, ranhrl (Ran Harel) wrote…
why u refering me to this link? Comments from Reviewable |
Review status: all files reviewed at latest revision, 6 unresolved discussions, some commit checks failed. remote/mounter/block_device_utils/mpath.go, line 168 at r1 (raw file): Previously, shay-berman wrote…
Done. utils/executor.go, line 74 at r1 (raw file): Previously, ranhrl (Ran Harel) wrote…
I agree with Ran. Also, milliseconds seems like a standard when it comes to timeouts of function calls. Lets keep it this way. utils/executor.go, line 80 at r1 (raw file): Previously, shay-berman wrote…
It should work. I'll try it and tell you when I go over the logs. utils/executor.go, line 86 at r1 (raw file): Previously, shay-berman wrote…
Done. utils/executor.go, line 92 at r1 (raw file): Previously, shay-berman wrote…
Done. utils/executor.go, line 95 at r1 (raw file): Previously, shay-berman wrote…
In the link you can see that in case timeout exceeded, then run returns an error. we return this error. Comments from Reviewable |
Review status: 2 of 4 files reviewed at latest revision, 7 unresolved discussions, some commit checks failed. utils/executor.go, line 75 at r4 (raw file):
What does the time.Duration doing? I don't see that they use it in the example https://golang.org/pkg/os/exec/#CommandContext Comments from Reviewable |
utils/executor.go, line 95 at r1 (raw file):
Comments from Reviewable |
Review status: 2 of 4 files reviewed at latest revision, 7 unresolved discussions, some commit checks failed. utils/executor.go, line 75 at r4 (raw file): Previously, ranhrl (Ran Harel) wrote…
https://stackoverflow.com/questions/17573190/how-to-multiply-duration-by-integer I saw it here. could be that it's not accurate, I'm not sure actually. Comments from Reviewable |
13725b6
to
c981ce2
Compare
…tests
This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)