please contact the developers

Reported by Robert Collins on 2010-08-19
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
High
Gary Poster
Storm
High
Gustavo Niemeyer

Bug Description

And so I am, so I am.

I'm in the middle of refactoring an lp bug search method from sqlobject to storm, and this is happening.

We get a resultset, call count() on it, change the backing data (using storm), then call count() again, and finally __getitem__.

To reproduce, my lp:~lifeles/launchpad/milestones branch will be of great assistance.
The blowing up outer layer looks like this:

    >>> params = BugTaskSearchParams(user=no_privs, bug=bug_one)
    >>> found_tasks = firefox_trunk.searchTasks(params)
    >>> found_tasks.count()
    0

When a nomination is approved, one task is created, targeted at
firefox_trunk.

    >>> firefox_ms_nomination.approve(no_privs)

    >>> firefox_ms_nomination.isApproved()
    True
    >>> firefox_ms_nomination.isProposed()
    False
    >>> firefox_ms_nomination.isDeclined()
    False

    >>> found_tasks.count()
    1
    >>> bugtask = found_tasks[0]

And the exception (I've added __str__ to have some hope of debugging this).

      File "<doctest bug-nomination.txt[69]>", line 1, in <module>
      File "/home/robertc/launchpad/lp-branches/working/lib/canonical/launchpad/components/decoratedresultset.py", line 98, in __getitem__
        value = self.result_set.__getitem__(*args, **kwargs)
      File "/home/robertc/launchpad/lp-sourcedeps/eggs/storm-0.17-py2.6-linux-x86_64.egg/storm/store.py", line 997, in __getitem__
        obj = result_set._any()
      File "/home/robertc/launchpad/lp-sourcedeps/eggs/storm-0.17-py2.6-linux-x86_64.egg/storm/store.py", line 1086, in _any
        return self._load_objects(result, values)
      File "/home/robertc/launchpad/lp-sourcedeps/eggs/storm-0.17-py2.6-linux-x86_64.egg/storm/store.py", line 972, in _load_objects
        return self._find_spec.load_objects(self._store, result, values)
      File "/home/robertc/launchpad/lp-sourcedeps/eggs/storm-0.17-py2.6-linux-x86_64.egg/storm/store.py", line 1710, in load_objects
        values[values_start:values_end])
      File "/home/robertc/launchpad/lp-sourcedeps/eggs/storm-0.17-py2.6-linux-x86_64.egg/storm/store.py", line 709, in _load_object
        values, keep_defined=True)
      File "/home/robertc/launchpad/lp-sourcedeps/eggs/storm-0.17-py2.6-linux-x86_64.egg/storm/store.py", line 772, in _set_values
        column, lazy_value, value))
    RuntimeError: Unexpected situation. Please contact the developers. column <class 'lp.bugs.model.bug.Bug'>.heat, oldvalue SQL calculate_bug_heat(1) Undef Undef value 0

(the exception source is now:
                    raise RuntimeError("Unexpected situation. Please contact "
                        "the developers. column %s, oldvalue %s value %s" % (
                        column, lazy_value, value))
)

'calculate_bug_heat()' is a SQL function which we use to get the heat, and 0 is the bug heat.

So this is *AFAICT* correctly setting the objects heat to the value we want to get from the DB.

OTOH perhaps the lazy value should never have been set. I've no idea where to go from here as I don't understand why the exception is being raised anyway : any help gratefully appreciated.

Related branches

lp:~niemeyer/storm/bug-620615
Merged into lp:storm at revision 377
Thomas Herve: Needs Information on 2010-10-17
Jamu Kakar: Approve on 2010-10-17
Changed in storm:
assignee: nobody → Gustavo Niemeyer (niemeyer)
status: New → In Progress
importance: Undecided → High
milestone: none → 0.18
Changed in storm:
status: In Progress → Fix Committed
Gary Poster (gary) on 2010-10-25
Changed in launchpad-foundations:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Gary Poster (gary)
Changed in launchpad-foundations:
milestone: none → 10.11
tags: added: qa-needstesting
Changed in launchpad-foundations:
status: Triaged → Fix Committed
Gary Poster (gary) on 2010-10-26
Changed in storm:
status: Fix Committed → Fix Released
Gary Poster (gary) on 2010-10-28
tags: added: qa-untestable
removed: qa-needstesting
Curtis Hovey (sinzui) on 2010-11-17
Changed in launchpad-foundations:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers