Skip to content

DAOS-18795 control: Fix TestSystem_Database_LeadershipCallbacks#17981

Open
mjmac wants to merge 1 commit intomasterfrom
mjmac/DAOS-18795
Open

DAOS-18795 control: Fix TestSystem_Database_LeadershipCallbacks#17981
mjmac wants to merge 1 commit intomasterfrom
mjmac/DAOS-18795

Conversation

@mjmac
Copy link
Copy Markdown
Contributor

@mjmac mjmac commented Apr 10, 2026

Fix a go unit test bug that caused occasional test hangs. Also
fixes a couple of subtle unprotected access bugs that were found
while investigating.

Features: control
Signed-off-by: Michael MacDonald github@macdonald.cx

@mjmac mjmac requested review from a team as code owners April 10, 2026 20:42
@github-actions
Copy link
Copy Markdown

Ticket title is 'TestSystem_Database_LeadershipCallbacks go unit test hang'
Status is 'In Review'
https://daosio.atlassian.net/browse/DAOS-18795

Fix a go unit test bug that caused occasional test hangs. Also
fixes a couple of subtle unprotected access bugs that were found
while investigating.

Features: control
Signed-off-by: Michael MacDonald <github@macdonald.cx>
@mjmac mjmac force-pushed the mjmac/DAOS-18795 branch from 4bd44fa to 722ac52 Compare April 11, 2026 20:26
// Return copies of the registered callbacks under a lock, so that they
// can be safely retrieved and executed without holding the lock.
func (db *Database) onLeadershipGainedCbs() []onLeadershipGainedFn {
db.cbMutex.Lock()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason these couldn't be readlocks? Since these cb functions are just reading back the contents of the arrays. Could prevent unnecessary blocking as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants