Skip to content

Commit c682ccb

Browse files
authored
vine: replace printf with debug(D_NOTICE) (#4027)
* vine: replace printf with debug(D_NOTICE) * add braces * add braces * add braces * add brace
1 parent 5d81eab commit c682ccb

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

taskvine/src/manager/vine_manager.c

+13-10
Original file line numberDiff line numberDiff line change
@@ -554,11 +554,12 @@ static vine_result_code_t get_completion_result(struct vine_manager *q, struct v
554554
original->library_failed_count++;
555555
original->time_when_last_failure = timestamp_get();
556556
}
557-
printf("Library %s failed on worker %s (%s)", t->provides_library, w->hostname, w->addrport);
558-
if (q->watch_library_logfiles)
559-
printf(", check the library log file %s\n", t->library_log_path);
560-
else
561-
printf(", enable watch-library-logfiles for debug\n");
557+
debug(D_VINE | D_NOTICE, "Library %s failed on worker %s (%s)", t->provides_library, w->hostname, w->addrport);
558+
if (q->watch_library_logfiles) {
559+
debug(D_VINE | D_NOTICE, ", check the library log file %s\n", t->library_log_path);
560+
} else {
561+
debug(D_VINE | D_NOTICE, ", enable watch-library-logfiles for debug\n");
562+
}
562563
} else {
563564
/* Update task stats for this completion. */
564565
observed_execution_time = timestamp_get() - t->time_when_commit_end;
@@ -2859,8 +2860,9 @@ static void count_worker_resources(struct vine_manager *q, struct vine_worker_in
28592860

28602861
static void update_max_worker(struct vine_manager *q, struct vine_worker_info *w)
28612862
{
2862-
if (!w)
2863+
if (!w) {
28632864
return;
2865+
}
28642866

28652867
if (w->resources->workers.total < 1) {
28662868
return;
@@ -3213,8 +3215,9 @@ int vine_manager_transfer_capacity_available(struct vine_manager *q, struct vine
32133215
}
32143216

32153217
/* If that resulted in a match, move on to the next file. */
3216-
if (found_match)
3218+
if (found_match) {
32173219
continue;
3220+
}
32183221

32193222
/*
32203223
If no match was found, the behavior depends on the original file type.
@@ -4670,8 +4673,9 @@ int vine_submit(struct vine_manager *q, struct vine_task *t)
46704673
t->time_when_submitted = timestamp_get();
46714674
q->stats->tasks_submitted++;
46724675

4673-
if (q->monitor_mode != VINE_MON_DISABLED)
4676+
if (q->monitor_mode != VINE_MON_DISABLED) {
46744677
vine_monitor_add_files(q, t);
4678+
}
46754679

46764680
rmsummary_merge_max(q->max_task_resources_requested, t->resources_requested);
46774681

@@ -4700,8 +4704,7 @@ struct vine_task *send_library_to_worker(struct vine_manager *q, struct vine_wor
47004704
*/
47014705
if (original->library_failed_count > q->max_library_retries) {
47024706
vine_manager_remove_library(q, name);
4703-
debug(D_VINE, "library %s has reached the maximum failure count %d, it has been removed", name, q->max_library_retries);
4704-
printf("library %s has reached the maximum failure count %d, it has been removed\n", name, q->max_library_retries);
4707+
debug(D_VINE | D_NOTICE, "library %s has reached the maximum failure count %d, it has been removed\n", name, q->max_library_retries);
47054708
return 0;
47064709
}
47074710

taskvine/src/manager/vine_schedule.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,9 @@ int check_worker_against_task(struct vine_manager *q, struct vine_worker_info *w
185185
/* Don't send tasks if the factory is used and has too many connected workers. */
186186
if (w->factory_name) {
187187
struct vine_factory_info *f = vine_factory_info_lookup(q, w->factory_name);
188-
if (f && f->connected_workers > f->max_workers)
188+
if (f && f->connected_workers > f->max_workers) {
189189
return 0;
190+
}
190191
}
191192

192193
/* Check if worker is blocked from the manager. */

0 commit comments

Comments
 (0)