[Bugs] #4841 Sugar NORM: Only some newly installed system-wide activities are favorites

Sugar Labs Bugs bugtracker-noreply at sugarlabs.org
Wed Jun 24 18:45:37 EDT 2015


#4841: Only some newly installed system-wide activities are favorites
---------------------+-------------------------------------
  Reporter:  quozl   |            Owner:
      Type:  defect  |           Status:  new
  Priority:  Normal  |        Milestone:
 Component:  Sugar   |          Version:  Git as of bugdate
  Severity:  Minor   |       Resolution:
  Keywords:          |  Distribution/OS:  Ubuntu
Bug Status:  New     |
---------------------+-------------------------------------
\
\
\
\
\
\

Comment (by tch):

 Regarding your Test case # 4, the BundleRegistry misses some activities in
 favorites/list because GFileMonitor emits events when there are still no
 activity/activity.info file in the activity directory, thus the
 BundleRegistry skips it and the bundle is never added.

 This happens randomly (more or less, 3 out of 38), but from what I checked
 it seems to happen more often on activities packages with bigger sizes
 e.g, sugar-help-activity.

 The problem with this is that the BundleRegistry only interacts with the
 package manager through the file system events, therefore we can't have
 full control of what is happening with these directories. From the
 different things I tried, the simplest option [1] was to add a delay to
 the processing of the paths in the GFileMonitor callback. This is only an
 imperfect workaround and can't guarantee that it will work with bigger
 size packages.

 I posted the logs of a couple tests, with [2] and without [3] the
 workaround. I added custom logging entries to make sense of the different
 stages.

 For [2] I even temporarily changed the GFileMonitor event to
 G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT instead of
 G_FILE_MONITOR_EVENT_CREATED because it is supposed to be emitted at the
 end, but made no difference. It shows how the activity/activity.info file
 is still no accessible ("bundle_from_dir exists False") even when
 GFileMonitor emitted the CREATED signal, and that it only happens with a
 few cases while it does work for the most.

 On the other hand, by simply adding the delay [3], all the activity
 contents can be accessed ("bundle_from_dir exists True").

 Alternatives I discarded:
 * inotify not detecting all events. I tested with inotifywatch, and
 verified that it detected every single change in the
 /usr/share/sugar/activities/.
 * GFileMonitor missing events. All events are properly informed to
 BundleRegistry, not a single event got missed, BUT, I detected a separate
 problem though: when uninstalling all the activities (see my testing steps
 below), the /usr/share/sugar/activities/ directory was also removed which
 makes the GFileMonitor miss some events.
 * GFileMonitor rate limits. Changes to the rate limit made no difference
 at (tried with 0, 1 and 10000).
 * Bundle processing workload. The bundle processing workload made no
 difference, I even tried completely removing the processing and made no
 difference.

 Steps I used to reproduce (using Ubuntu 14.04):

 1. sudo dpkg --remove --force-depends sugar-abacus-activity sugar-browse-
 activity sugar-calculate-activity sugar-chart-activity sugar-chat-activity
 sugar-clock-activity sugar-develop-activity sugar-distance-activity sugar-
 finance-activity sugar-fototoon-activity sugar-fractionbounce-activity
 sugar-gears-activity sugar-get-books-activity sugar-help-activity sugar-
 image-viewer-activity sugar-implode-activity sugar-jukebox-activity sugar-
 labyrinth-activity sugar-letters-activity sugar-log-activity sugar-maze-
 activity sugar-measure-activity sugar-memorize-activity sugar-moon-
 activity sugar-paint-activity sugar-physics-activity sugar-pippy-activity
 sugar-poll-activity sugar-portfolio-activity sugar-read-activity sugar-
 record-activity sugar-speak-activity sugar-stopwatch-activity sugar-story-
 activity sugar-terminal-activity sugar-turtleart-activity sugar-words-
 activity sugar-write-activity

 2. sudo mkdir /usr/share/sugar/activities/

 3. (optional, from a different terminal) tailf
 ~/.sugar/default/logs/shell.log
 4. (optional, from a different terminal) inotifywatch --verbose
 /usr/share/sugar/activities/

 4. sudo apt-get install sugar-abacus-activity sugar-browse-activity sugar-
 calculate-activity sugar-chart-activity sugar-chat-activity sugar-clock-
 activity sugar-develop-activity sugar-distance-activity sugar-finance-
 activity sugar-fototoon-activity sugar-fractionbounce-activity sugar-
 gears-activity sugar-get-books-activity sugar-help-activity sugar-image-
 viewer-activity sugar-implode-activity sugar-jukebox-activity sugar-
 labyrinth-activity sugar-letters-activity sugar-log-activity sugar-maze-
 activity sugar-measure-activity sugar-memorize-activity sugar-moon-
 activity sugar-paint-activity sugar-physics-activity sugar-pippy-activity
 sugar-poll-activity sugar-portfolio-activity sugar-read-activity sugar-
 record-activity sugar-speak-activity sugar-stopwatch-activity sugar-story-
 activity sugar-terminal-activity sugar-turtleart-activity sugar-words-
 activity sugar-write-activity

 [1]
 https://github.com/tchx84/sugar/commit/2b5c81e0d1954b70878b0fa5fc9d55ae6734e7ed
 [2] http://fpaste.org/236346/84689143/
 [3] http://fpaste.org/236348/85323143/
\
\
\

--
Ticket URL: <http://bugs.sugarlabs.org/ticket/4841#comment:17>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list