Skip to content

Commit d2428ec

Browse files
committed
Merge pull request #47 from evoskuil/master
Fix abort on publisher start failure.
2 parents 74f36c8 + e7ea25b commit d2428ec

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/server.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,11 @@ static console_result run(settings_type& config, std::ostream& output,
257257
{
258258
error << format(BS_PUBLISHER_START_FAIL) %
259259
zmq_strerror(zmq_errno()) << std::endl;
260+
261+
// This is a bit wacky, since the node hasn't been started yet, but
262+
// there is threadpool cleanup code in here.
263+
full_node.stop();
264+
260265
return console_result::not_started;
261266
}
262267

@@ -267,6 +272,11 @@ static console_result run(settings_type& config, std::ostream& output,
267272
if (!full_node.start(config))
268273
{
269274
error << BS_NODE_START_FAIL << std::endl;
275+
276+
// This is a bit wacky, since the node hasn't been started yet, but
277+
// there is threadpool cleanup code in here.
278+
full_node.stop();
279+
270280
return console_result::not_started;
271281
}
272282

0 commit comments

Comments
 (0)