-
Notifications
You must be signed in to change notification settings - Fork 30
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
[TA1143] Fix deadlock issue in finish_async_tasks. #71
Changes from 2 commits
8e3e020
c505fed
1190f52
b3755d1
534ee79
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -497,6 +497,8 @@ uzfs_zvol_mgmt_do_handshake(uzfs_mgmt_conn_t *conn, zvol_io_hdr_t *hdrp, | |
*/ | ||
mgmt_ack.zvol_guid = dsl_dataset_phys( | ||
zv->zv_objset->os_dsl_dataset)->ds_guid; | ||
zinfo->zvol_guid = mgmt_ack.zvol_guid; | ||
LOG_INFO("Volume:%s has zvol_guid:%lu", zinfo->name, zinfo->zvol_guid); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a nit but can we improve the message as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
|
||
bzero(&hdr, sizeof (hdr)); | ||
hdr.version = REPLICA_VERSION; | ||
|
@@ -593,9 +595,8 @@ finish_async_tasks(void) | |
rc = reply_nodata(async_task->conn, async_task->status, | ||
async_task->hdr.opcode, async_task->hdr.io_seq); | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should not ignore rc here. If epoll fails then it is a serious error leading to internally inconsistent state which is difficult to recover from. we could just break if rc != 0 and change final return to return (rc). That will take care of releasing the mutex. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed deadlock issue. I will raise a PR to address mgmt_thread exit issue which need discussion among team members. |
||
free_async_task(async_task); | ||
if (rc != 0) | ||
return (rc); | ||
} | ||
mutex_exit(&async_tasks_mtx); | ||
return (0); | ||
|
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.
from the prctl man page:
we cannot store the whole guid there. We can number them from 1 to n (using increasing static counter). However I would probably just revert it to the previous code and just have a name io_receiver for all such threads. By using gdb we can always figure out which pool it belongs to (printing zinfo). Unless there is some advantage if the thread name is unique.
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.
similar command applies to the other thread below.
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.
Reverted back this change