-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 assert failed when timeout during call rate_ddir #1648
Conversation
This needs a MUCH better description in the actual commit message. There's nothing in there, you left it all on the github pull request message which won't go into the tree. You also need the Signed-off-by in there, no in the git pull request. |
io_u.c
Outdated
@@ -952,6 +953,11 @@ static int fill_io_u(struct thread_data *td, struct io_u *io_u) | |||
set_rw_ddir(td, io_u); | |||
|
|||
if (io_u->ddir == DDIR_INVAL) { | |||
now = utime_since_now(&td->epoch); |
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 think we should be duplicating this timeout check. This fix very much feels like it's just papering around the symptoms rather than fixing the core issue, which is that we can get DDIR_INVAL if we have timed out.
io_u.c
Outdated
break; | ||
|
||
zbd_put_io_u(td, io_u); | ||
|
||
put_file_log(td, f); | ||
td_io_close_file(td, f); | ||
io_u->file = NULL; | ||
|
||
if (ret == 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.
And this is why I think it's papering around it, you introduce some random other return value for this condition.
Caveat - haven't attempted to reproduce this, but can't we just do:
and be done with it? |
Or probably this is the better way, same kind of thing:
|
Thank you very much for your reminder. I will add description and Signed-off-by in the commit message. |
I did ponder whether DDIR_TIMEOUT would be a solution, since it's much cleaner than hacking in odd return values and needing to check it twice. That provides a way to pass this information back inline, rather than out-of-band. I think that proposed patch looks MUCH better than the original one. |
68ced00
to
c8be452
Compare
Thanks very much, I have already updated this commit according to the proposed patch and added the description and Signed-off-by in the commit message. |
io_u.c
Outdated
@@ -1419,6 +1419,11 @@ static long set_io_u_file(struct thread_data *td, struct io_u *io_u) | |||
put_file_log(td, f); | |||
td_io_close_file(td, f); | |||
io_u->file = NULL; | |||
|
|||
if (io_u->ddir == DDIR_TIMEOUT) { |
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.
No braces necessary here.
Looks much better, just one minor style issue. Outside of that, please line wrap commit messages at around 72 chars. Long lines are hard to read in git log. With those two things tweaked, this should be ready to go in. |
Once I triggered CI, it failed. The cases where we have a switch based on ddir, you need to also add DDIR_TIMEOUT to the DDIR_INVAL cases. |
Adding DDIR_TIMEOUT in enum fio_ddir, and rate_ddir returns it when fio timeouts. set_io_u_file will directly break out of the loop, and fill_io_u won't be called, which causes assert to fail in rate_ddir, because td->rwmix_ddir is DDIR_INVAL. Signed-off-by: QingSong Zhu zhuqingsong.0909@bytedance.com
c8be452
to
e8a0b53
Compare
Thanks! |
fix assert failed when timeout during call rate_ddir
Adding DDIR_TIMEOUT in enum
fio_ddir
, andrate_ddir
returns it when fio timeouts.set_io_u_file
will directly break out of the loop, andfill_io_u
won't be called again, which causes assert to fail inrate_ddir
, because td->rwmix_ddir is DDIR_INVAL.Signed-off-by: QingSong Zhu zhuqingsong.0909@bytedance.com