Repository navigation
vine: delete the replaced recovery task of a temp file - #4516
JinZhou5042 wants to merge 2 commits into
Conversation
btovar
left a comment
There was a problem hiding this comment.
Are we sure that the pointer of previous is not being used anywhere else? Would it be better to skip the creation of the new recovery task and simply use previous?
d14b629 to
03b6674
Compare
|
Yes, it is safe because Even if we could reuse the previous one conceptually, And the root cause is that this line takes a reference to the new recovery task but never gives back the one it held on the old task, so it leaks every time the file already has a recovery task |
|
That's my worry. Not that we will have segfault, but that some other part of the system still refers to the old task. What happens when two tasks refer to the same temp file? |
|
Every holder of the old recovery task has its own reference and replacing it only drops the file's reference, so it is safe? |
|
So either the old pointer is held somewhere else and it is still valid and we should not create a new recovery tasks, or it is not, which means we have the potential to a hidden bug? I'm not talking about memory issues, but whether the system behaves as it should. |
|
But this pr doesn't change the system's behavior? Since we already point the file at the newest task's copy, and this only releases the reference to the old copy that the assignment used to leak |
|
the file added a reference to the old recovery task previously, so that reference has to be dropped anyway |
|
From the other issue that you mention, what happens when the recovery task generates two files but only one is lost? |
|
If a task creates two files and only one is lost, the recovery task reruns the whole task and recreates both files. The only side effect is that we have one extra copy of the good file, and the reference count here is correct since both files point to the same recovery task If the same task is submitted twice by the user, all of its files would now point to the newest task and drop the old one. Other parties in the system can still use the old task if they previously added a reference to it. The only problematic scenario is when multiple tasks create the same file, which causes chaos. But that is a separate problem, since allowing multiple tasks to create the same file probably shouldn't be allowed in the first place? |
Proposed Changes
For #4515
Merge Checklist
The following items must be completed before PRs can be merged.
Check these off to verify you have completed all steps.
make testRun local tests prior to pushing.make formatFormat source code to comply with lint policies. Note that some lint errors can only be resolved manually (e.g., Python)make lintRun lint on source code prior to pushing.