Skip to content

Commit

Permalink
vine: assume file created on declaration until specified as output (#…
Browse files Browse the repository at this point in the history
…3975)

* check created state for regular files

* set local file state on creation

* declare file in created state
  • Loading branch information
colinthomas-z80 authored Nov 8, 2024
1 parent 40f5d5e commit e347043
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion taskvine/src/manager/vine_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ struct vine_file *vine_file_create(const char *source, const char *cached_name,
f->size = size;
f->mini_task = mini_task;
f->recovery_task = 0;
f->state = VINE_FILE_STATE_PENDING;
f->state = VINE_FILE_STATE_CREATED; /* Assume state created until told otherwise */
f->cache_level = cache_level;
f->flags = flags;

Expand Down
4 changes: 3 additions & 1 deletion taskvine/src/manager/vine_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -3249,7 +3249,9 @@ static int vine_manager_check_inputs_available(struct vine_manager *q, struct vi
LIST_ITERATE(t->input_mounts, m)
{
struct vine_file *f = m->file;
if (f->type == VINE_TEMP && f->state == VINE_FILE_STATE_CREATED) {
if (f->type == VINE_FILE && f->state == VINE_FILE_STATE_PENDING) {
all_available = 0;
} else if (f->type == VINE_TEMP && f->state == VINE_FILE_STATE_CREATED) {
if (!vine_file_replica_table_exists_somewhere(q, f->cached_name)) {
vine_manager_consider_recovery_task(q, f, f->recovery_task);
all_available = 0;
Expand Down
2 changes: 2 additions & 0 deletions taskvine/src/manager/vine_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,8 @@ int vine_task_add_output(struct vine_task *t, struct vine_file *f, const char *r
return 0;
}

f->state = VINE_FILE_STATE_PENDING;

struct vine_mount *m = vine_mount_create(f, remote_name, flags, 0);

list_push_tail(t->output_mounts, m);
Expand Down

0 comments on commit e347043

Please sign in to comment.