Bug #7100

[Workbench] Reusing ArvadosResourceList results in inconsistent results

Added by Radhika Chippada almost 4 years ago. Updated over 3 years ago.

Status:
New
Priority:
Normal
Assigned To:
-
Category:
-
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Story points:
-

Description

See #6640 for a historical perspective of this issue. In that issue, it was observed that the results of all_projects were different when invoked in different contexts. In note #21 of that issue, Tom added a detailed described (pasted below). It is desirable that we stop reusing the ArvadosResourceList object so that the results are not mangled in various invocations.

(Pasted from note #21 of #6640):

It would be even better to fix the ArvadosResourceList API so the caller doesn't have to remember to dup in cases like this -- i.e., each method like limit() acts more like merge(), returning a new ArvadosResourceList object instead of modifying itself in place -- and it might not even be that hard. If we can't deal with that, I wonder if there is at least a systematic way we can identify similar usage errors that are causing (or likely to cause) similar bugs?

set_a = Fubar.filter [['foo', '=', 'bar']]
set_b = set_a.filter [['baz', '=', 'waz']]
set_c = set_b.limit 5
set_a.each do |x|
  puts x
end

# Naturally expected behavior:
#  print all results matching foo=bar

# Actual behavior:
#  print <= 5 results matching foo=bar && baz=waz

History

#1 Updated by Radhika Chippada almost 4 years ago

  • Description updated (diff)

#2 Updated by Brett Smith over 3 years ago

  • Target version changed from Bug Triage to Arvados Future Sprints

Also available in: Atom PDF