please contact the developers

Bug #620615 reported by Robert Collins on 2010-08-19
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Gary Poster
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()

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

    >>> firefox_ms_nomination.approve(no_privs)

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

    >>> found_tasks.count()
    >>> 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/", 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/", 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/", 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/", 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/", line 1710, in load_objects
      File "/home/robertc/launchpad/lp-sourcedeps/eggs/storm-0.17-py2.6-linux-x86_64.egg/storm/", 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/", 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

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