Skip to content

Commit 66e5dfe

Browse files
authored
Fix a few issues that I ran into when running make cluster (#698)
I ran make cluster with ``` make cluster -j20 TMUX_LAYOUT=tiled NODES=3 ```
1 parent bcdaf3b commit 66e5dfe

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,13 @@ $(TMUX_SCRIPT): bin
195195

196196
tmux-script: $(TMUX_SCRIPT) ;
197197

198-
tmux-clean:
198+
tmux-clean: bin
199199
$(PG_AUTOCTL) do tmux clean \
200200
--root $(TMUX_TOP_DIR) \
201201
--first-pgport $(FIRST_PGPORT) \
202202
--nodes $(NODES)
203203

204-
tmux-session:
204+
tmux-session: bin
205205
$(PG_AUTOCTL) do tmux session \
206206
--root $(TMUX_TOP_DIR) \
207207
--first-pgport $(FIRST_PGPORT) \
@@ -213,7 +213,11 @@ tmux-session:
213213
--binpath $(BINPATH) \
214214
--layout $(TMUX_LAYOUT)
215215

216-
cluster: install tmux-clean tmux-session ;
216+
cluster: install tmux-clean
217+
# This is explicitly not a target, otherwise when make uses multiple jobs
218+
# tmux-clean and tmux-session can have a race condidition where tmux-clean
219+
# removes the files that are just created by tmux-session.
220+
$(MAKE) tmux-session
217221

218222
valgrind-session: build-test
219223
docker run \

src/bin/pg_autoctl/main.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,19 @@ main(int argc, char **argv)
130130
* environment variable.
131131
*/
132132
strlcpy(pg_autoctl_argv0, argv[0], MAXPGPATH);
133-
if (!get_env_copy("PG_AUTOCTL_DEBUG_BIN_PATH", pg_autoctl_program, MAXPGPATH))
133+
if (env_exists("PG_AUTOCTL_DEBUG_BIN_PATH"))
134134
{
135-
if (!set_program_absolute_path(pg_autoctl_program, MAXPGPATH))
135+
if (!get_env_copy("PG_AUTOCTL_DEBUG_BIN_PATH", pg_autoctl_program, MAXPGPATH))
136136
{
137137
/* errors have already been logged */
138138
exit(EXIT_CODE_INTERNAL_ERROR);
139139
}
140140
}
141+
else if (!set_program_absolute_path(pg_autoctl_program, MAXPGPATH))
142+
{
143+
/* errors have already been logged */
144+
exit(EXIT_CODE_INTERNAL_ERROR);
145+
}
141146

142147
if (!commandline_run(&command, argc, argv))
143148
{

0 commit comments

Comments
 (0)