Skip to content

vine: release the files of a removed library - #4495

Merged
btovar merged 8 commits into
cooperative-computing-lab:masterfrom
JinZhou5042:fix_remove_library_files
Nov 19, 2026
Merged

btovar merged 8 commits into
cooperative-computing-lab:masterfrom
JinZhou5042:fix_remove_library_files

Conversation

@JinZhou5042

@JinZhou5042 JinZhou5042 commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Proposed Changes

remove_library() now leaves the files that create_library_from_functions() declared for the library, so they stay on every worker until the manager exits. Instead, remove_library() should undeclare them upon removal

Merge Checklist

The following items must be completed before PRs can be merged.
Check these off to verify you have completed all steps.

  • make test Run local tests prior to pushing.
  • make format Format source code to comply with lint policies. Note that some lint errors can only be resolved manually (e.g., Python)
  • make lint Run lint on source code prior to pushing.
  • Manual Update: Update the manual to reflect user-visible changes.
  • Type Labels: Select a github label for the type: bugfix, enhancement, etc.
  • Product Labels: Select a github label for the product: TaskVine, Makeflow, etc.
  • PR RTM: Mark your PR as ready to merge.

@JinZhou5042
JinZhou5042 force-pushed the fix_remove_library_files branch 3 times, most recently from 5355c94 to 937d93e Compare October 9, 2026 18:33
@JinZhou5042 JinZhou5042 self-assigned this Oct 9, 2026
@JinZhou5042 JinZhou5042 added the bug For modifications that fix a flaw in the code. label Oct 11, 2026
@btovar

btovar commented Oct 12, 2026

Copy link
Copy Markdown
Member

I'm not sure why this one is needed? Shouldn't the files from the library be removed from C as any other structure that has files? If there's a leak, it is from the C side, right?

@JinZhou5042

Copy link
Copy Markdown
Member Author

You're right that there is a leak on the C side too. vine_manager_remove_library() drops the template from library_templates but never frees it, and library tasks leave freeing to the manager, so the template and its references to these files are leaked. That should be fixed in C.

But freeing the template only drops the library's reference to the files. The files belong to whoever declared them, not to the library. Here the declarer is create_library_from_functions(). It declares the library code and info files on the user's behalf and never gives them back:

image

So the user has no way to undeclare them, and they stay on every worker until the manager exits. This PR makes remove_library() undeclare the files that create_library_from_functions() declared.

@JinZhou5042
JinZhou5042 force-pushed the fix_remove_library_files branch from 937d93e to a489c98 Compare October 12, 2026 21:20
@JinZhou5042

Copy link
Copy Markdown
Member Author

@btovar I also fixed the leaks in the C part

@btovar

btovar commented Oct 13, 2026

Copy link
Copy Markdown
Member

I think we should hold this one out. This is the same pattern we would have for a regular task that is created, filled, but never submitted? If so, I rather solve it in the general.

@JinZhou5042
JinZhou5042 force-pushed the fix_remove_library_files branch from 6c9208c to bd905ac Compare October 14, 2026 20:37
@JinZhou5042

Copy link
Copy Markdown
Member Author

Yes, I think you are right! Now it follows the same pattern as a regular task, so a library that's never installed is covered too.

@btovar
btovar merged commit 69450e9 into cooperative-computing-lab:master Nov 19, 2026
12 of 13 checks passed
JinZhou5042 added a commit to JinZhou5042/cctools that referenced this pull request Nov 23, 2026
This brings upstream master with it: the new hash_table (cooperative-computing-lab#4556) and the merged release of a removed library's
files (cooperative-computing-lab#4495). hash_table is upstream's as it is, and the callers follow its interface: no hash_table_compact() in
compact_tables() and vine_manager_data_service_compact(), hash_table_keys() for the names a worker loses, and
upstream's vine_manager_release_random_worker(). itable and set keep their compaction.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug For modifications that fix a flaw in the code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants