Skip to content
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

drmgr/lsslot: DR lock acquisition is flaky #98

Open
nathanlynch opened this issue May 3, 2024 · 0 comments
Open

drmgr/lsslot: DR lock acquisition is flaky #98

nathanlynch opened this issue May 3, 2024 · 0 comments
Labels

Comments

@nathanlynch
Copy link
Contributor

nathanlynch commented May 3, 2024

Run two instances of lsslot concurrently and often one of them will error out:

[root@ltczep4-lp3 ~]# lsslot & lsslot
[1] 2920840
/var/lock/dr_config_lock: Resource temporarily unavailable
[root@ltczep4-lp3 ~]# # Slot                      Description       Linux Name    Device(s)
U9040.MR9.1328F4X-V10-C0    Virtual I/O Slot  30000000      vty
U9040.MR9.1328F4X-V10-C2    Virtual I/O Slot  30000002      l-lan
U9040.MR9.1328F4X-V10-C103  Virtual I/O Slot  30000067      v-scsi

[1]+  Done                    lsslot

The intention of dr_lock() is to wait for the lock either indefinitely or until an optional timeout expires. But at this point in the program's execution, the dr_timeout variable is always 0 since main() has yet to call set_timeout(). This causes any lock contention to make the program exit:

int drmgr_timed_out(void)
{
	if (dr_timeout == -1)
		return 0;	/* No timeout specified */

	if (dr_timeout > time((time_t *)0))
		return 0;

	say(WARN, "Drmgr has exceeded its specified wait time and will not "
	    "continue\n");
	return 1;
}

lsslot makes for an easy illustration, but more importantly I believe this problem affects the drmgr command as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant