Ruby: error checking during thread creation.

Application terminates in case of thread creation failure.
This commit is contained in:
Max Romanov
2020-11-05 17:02:55 +03:00
parent fc9a012ceb
commit 2220b8258f

View File

@@ -1150,6 +1150,8 @@ nxt_ruby_ready_handler(nxt_unit_ctx_t *ctx)
} else { } else {
nxt_unit_alert(ctx, "thread #%d create failed", (int) (i + 1)); nxt_unit_alert(ctx, "thread #%d create failed", (int) (i + 1));
return NXT_UNIT_ERROR;
} }
} }
@@ -1264,8 +1266,10 @@ nxt_ruby_join_threads(nxt_unit_ctx_t *ctx, nxt_ruby_app_conf_t *c)
} else { } else {
nxt_unit_debug(ctx, "thread #%d not started", (int) (i + 1)); nxt_unit_debug(ctx, "thread #%d not started", (int) (i + 1));
} }
}
nxt_ruby_ctx_done(rctx); for (i = 0; i < c->threads - 1; i++) {
nxt_ruby_ctx_done(&nxt_ruby_ctxs[i]);
} }
nxt_unit_free(ctx, nxt_ruby_ctxs); nxt_unit_free(ctx, nxt_ruby_ctxs);