Skip to content

Commit d850082

Browse files
committed
fix data race on accessing props and model_meta
1 parent 0bb9bc4 commit d850082

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

tools/server/server-context.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -863,9 +863,12 @@ struct server_context_impl {
863863
common_chat_templates_source(chat_templates.get()),
864864
common_chat_format_example(chat_templates.get(), params_base.use_jinja, params_base.default_template_kwargs).c_str());
865865

866-
if (!populate_json_responses()) {
867-
SRV_ERR("%s", "failed to populate JSON responses\n");
868-
return false;
866+
if (!is_resume) {
867+
// do not repopulate on resume, as HTTP threads may be still using the existing JSON data
868+
if (!populate_json_responses()) {
869+
SRV_ERR("%s", "failed to populate JSON responses\n");
870+
return false;
871+
}
869872
}
870873

871874
return true;

0 commit comments

Comments
 (0)