Opened 14 years ago

Last modified 10 years ago

#1936 new defect

sugar.datastore.datastore.find() breaks for large data stores

Reported by: sascha_silbe Owned by: erikos
Priority: Normal Milestone: Unspecified
Component: Sugar Version: Git as of bugdate
Severity: Blocker Keywords:
Cc: Distribution/OS:
Bug Status: New


sugar.datastore.datastore.find() doesn't explicitly set a DBus timeout, so the (in)sanely short default timeout is used. This causes it to break with a DBus timeout error rather easily. E.g. even with all entries in cache(!), find({}) always raises an error for a large data store:

Traceback (most recent call last):
  File "/home/sascha.silbe/sugar-jhbuild/install/bin/sugar-activity", line 21, in <module>
  File "/home/sascha.silbe/sugar-jhbuild/install/lib/python2.5/site-packages/sugar/activity/", line 159, in main
    create_activity_instance(activity_constructor, activity_handle)
  File "/home/sascha.silbe/sugar-jhbuild/install/lib/python2.5/site-packages/sugar/activity/", line 37, in create_activity_instance
    activity = constructor(handle)
  File "/home/sascha.silbe/sugar-jhbuild/install/share/sugar/activities/Janitor.activity/", line 112, in __init__
  File "/home/sascha.silbe/sugar-jhbuild/install/share/sugar/activities/Janitor.activity/", line 116, in _setup_widgets
  File "/home/sascha.silbe/sugar-jhbuild/install/share/sugar/activities/Janitor.activity/", line 123, in _setup_canvas
  File "/home/sascha.silbe/sugar-jhbuild/install/share/sugar/activities/Janitor.activity/", line 198, in _create_list_model
  File "/home/sascha.silbe/sugar-jhbuild/install/share/sugar/activities/Janitor.activity/", line 204, in _refresh_list
    jobjects = datastore.find({}, properties=self._properties)[0]
  File "/home/sascha.silbe/sugar-jhbuild/install/lib/python2.5/site-packages/sugar/datastore/", line 492, in find
  File "/usr/lib/pymodules/python2.5/dbus/", line 140, in __call__
  File "/usr/lib/pymodules/python2.5/dbus/", line 630, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

We should allow callers to specify a timeout and default to using a large value or even an infinite timeout (-1). If altering the function signature is too invasive for 0.88, we should backport at least the increased timeout.

Other functions in sugar.datastore.datastore are likely to be affected as well.

Change History (5)

comment:1 Changed 11 years ago by dnarvaez

  • Component changed from sugar-toolkit to Sugar

comment:2 Changed 11 years ago by dnarvaez

  • Milestone changed from 0.88.x to Unspecified

comment:3 Changed 11 years ago by dnarvaez

  • Bug Status changed from New to Unconfirmed

comment:4 Changed 11 years ago by dnarvaez

  • Bug Status changed from Unconfirmed to New

Bad issue, though I'm not too convinced increasing the timeout is the solution. Needs to be thought out carefully.

comment:5 Changed 10 years ago by godiard

  • Priority changed from High to Normal
Note: See TracTickets for help on using tickets.