Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita033f69

Browse files
committed
Fix a deadlock in the transfers test caused by random connection order.
1 parentdee9a9a commita033f69

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

‎contrib/pg_xtm/tests/transfers.go‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,14 @@ func transfer(id int, cCommits chan int, cAborts chan int, wg *sync.WaitGroup) {
138138
continue
139139
}
140140

141-
src:=conn[rand.Intn(2)]
142-
dst:=conn[rand.Intn(2)]
141+
srci:=rand.Intn(2)
142+
dsti:=rand.Intn(2)
143+
if (srci>dsti) {
144+
continue
145+
}
146+
147+
src:=conn[srci]
148+
dst:=conn[dsti]
143149

144150
ifsrc==dst {
145151
// local update

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp