Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 045c7d3

Browse files
committed
Make logging_collector=on work with non-windows EXEC_BACKEND again.
Commit b94ce6e reordered postmaster's startup sequence so that the tempfile directory is only cleaned up after all the necessary state for pg_ctl is collected. Unfortunately the chosen location is after the syslogger has been started; which normally is fine, except for !WIN32 EXEC_BACKEND builds, which pass information to children via files in the temp directory. Move the call to RemovePgTempFiles() to just before the syslogger has started. That's the first child we fork. Luckily EXEC_BACKEND is pretty much only used by endusers on windows, which has a separate method to pass information to children. That means the real world impact of this bug is very small. Discussion: 20150113182344.GF12272@alap3.anarazel.de Backpatch to 9.1, just as the previous commit was.
1 parent 4ebb349 commit 045c7d3

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/backend/postmaster/postmaster.c

+7-8
Original file line numberDiff line numberDiff line change
@@ -1143,6 +1143,12 @@ PostmasterMain(int argc, char *argv[])
11431143
on_proc_exit(unlink_external_pid_file, 0);
11441144
}
11451145

1146+
/*
1147+
* Remove old temporary files. At this point there can be no other
1148+
* Postgres processes running in this directory, so this should be safe.
1149+
*/
1150+
RemovePgTempFiles();
1151+
11461152
/*
11471153
* If enabled, start up syslogger collection subprocess
11481154
*/
@@ -1200,13 +1206,6 @@ PostmasterMain(int argc, char *argv[])
12001206
*/
12011207
}
12021208

1203-
1204-
/*
1205-
* Remove old temporary files. At this point there can be no other
1206-
* Postgres processes running in this directory, so this should be safe.
1207-
*/
1208-
RemovePgTempFiles();
1209-
12101209
#ifdef HAVE_PTHREAD_IS_THREADED_NP
12111210

12121211
/*
@@ -5859,7 +5858,7 @@ read_backend_variables(char *id, Port *port)
58595858
fp = AllocateFile(id, PG_BINARY_R);
58605859
if (!fp)
58615860
{
5862-
write_stderr("could not read from backend variables file \"%s\": %s\n",
5861+
write_stderr("could not open backend variables file \"%s\": %s\n",
58635862
id, strerror(errno));
58645863
exit(1);
58655864
}

0 commit comments

Comments
 (0)