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

Commitb68e356

Browse files
committed
worker_spi: Fix race condition in newly-added TAP tests
The second portion of the tests had a race condition where it would bepossible for the startup of the dynamic workers to fail, in the eventwhere the static workers started before them with the library loading inshared_preload_libraries did not finish to create their respectiveschemas. The conflict is caused by the fact that the dynamic and staticworkers used the same IDs, overlapping each other, so, for now, switchthe dynamic workers to use different IDs, leading to different schemascreated.Reported-by: Andres FreundDiscussion:https://postgr.es/m/20230728022332.egqzobhskmlf6ntr@awork3.anarazel.de
1 parent6d982e3 commitb68e356

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎src/test/modules/worker_spi/t/001_worker_spi.pl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@
6565
)ordie"Timed out while waiting for bgworkers to be launched";
6666

6767
# Ask worker_spi to launch dynamic bgworkers with the library loaded, then
68-
# check their existence.
69-
my$worker1_pid =$node->safe_psql('mydb','SELECT worker_spi_launch(1);');
70-
my$worker2_pid =$node->safe_psql('mydb','SELECT worker_spi_launch(2);');
68+
# check their existence. Use IDs that do not overlap with the schemas created
69+
# by the previous workers.
70+
my$worker1_pid =$node->safe_psql('mydb','SELECT worker_spi_launch(10);');
71+
my$worker2_pid =$node->safe_psql('mydb','SELECT worker_spi_launch(11);');
72+
7173
ok($node->poll_query_until(
7274
'mydb',
7375
qq[SELECT datname, count(datname) FROM pg_stat_activity

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp