After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 641396 - gnome-shell hangs when evolution-data-server is not available
gnome-shell hangs when evolution-data-server is not available
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
2.91.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-02-03 18:53 UTC by Matěj Cepl
Modified: 2011-02-28 21:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot of the situation (146.32 KB, image/png)
2011-02-07 11:25 UTC, Matěj Cepl
  Details
Patch that works (but also needs cleanup) (171.89 KB, patch)
2011-02-25 22:53 UTC, David Zeuthen (not reading bugmail)
needs-work Details | Review
Proposed patch (179.21 KB, patch)
2011-02-28 19:01 UTC, David Zeuthen (not reading bugmail)
none Details | Review
Updated patch (183.28 KB, patch)
2011-02-28 21:05 UTC, David Zeuthen (not reading bugmail)
none Details | Review

Description Matěj Cepl 2011-02-03 18:53:22 UTC
With gnome-shell-2.91.6-3.fc15 and evolution-data-server-2.91.6-2.fc15 e-d-s is not available to gnome-shell for some reason. However, because of the new Date applet on the top bar of g-s, gnome-shell hangs waiting on data from e-d-s and user never gets working desktop on the start. THere is only background and nothing else.

Situation when e-d-s is not available should be treated for somehow. I had to comment out these lines in /usr/share/gnome-shell/js/ui/panel.js (the first line 691):

//        /* center */
//        this._dateMenu = new DateMenu.DateMenuButton();
//        this._centerBox.add(this._dateMenu.actor, { y_fill: true });
//        this._menus.addMenu(this._dateMenu.menu);
Comment 1 David Zeuthen (not reading bugmail) 2011-02-03 19:00:24 UTC
<davidz> mbarnes: the problem is that it sometimes block... for GNOME 2 this was less of a problem as it only meant that the clock applet didn't display.. for GNOME 3, it blocks everything.. including your WM
 I mean, even with a sync API it shouldn't block forever
 IIRC jrb was able to reproduce this if he enabled encryption or something
 we could probably run the libeds code in a dedicated thread
 in the shell
 but I don't know if libeds is thread-safe
 if it is, maybe we should
 at least to avoid completely blocking the WM

<mbarnes> davidz: afaik, libecal is as thread-safe as GDBus is
<mbarnes> but yeah, the blocking issue plagues us too
<davidz> mbarnes: oh, in that case we should consider it (GDBus is 100% thread-safe)
 shouldn't be too much work to do the work in a thread
<mbarnes> yeah, that's probably the best way for now
 replacing EBook and ECal with better APIs is on my list for this year
Comment 2 Milan Crha 2011-02-07 10:38:55 UTC
The "no timeout" thing could be caused by my recent change, where I did disable timeout on dbus calls done by EBook/ECal structures.

Matej showed me his xsession-errors file and the caldav calendar is crashing for him for some reason. Let's start there.
Comment 3 Matěj Cepl 2011-02-07 11:25:38 UTC
Created attachment 180280 [details]
screenshot of the situation

one of possible reasons? Gnome pretends to support proxy.pac files, but not really.
Comment 4 Matěj Cepl 2011-02-22 17:58:36 UTC
two more datapoints:

a) proxy.pac is probably a red herring, it hangs without any proxy set up,
b) it is actually a problem somewhere around startup ... when I restarted gnome-shell later and e-d-s was already running, it worked without a problem.
Comment 5 David Zeuthen (not reading bugmail) 2011-02-25 22:53:13 UTC
Created attachment 181953 [details] [review]
Patch that works (but also needs cleanup)

Hey, I've been working on this the past couple of days. I ended up moving things out-of-process... anyway, the patch isn't completely cleaned up and I need to also write a few paragraphs about how things work.

Either way, I'm submitting the patch now so people can check if it works. I'll finish it Monday, gotta run now.

As an added bonus the patch also fixes bug 641057.

To test it just apply the patch and run './gnome-shell --replace' (I'm not sure it's enough to just do alt+f2, then r because of the src/gnome-shell.in changes ..the patch installs machinery to start the helper if running uninstalled... thanks in advance for testing!
Comment 6 David Zeuthen (not reading bugmail) 2011-02-28 19:01:01 UTC
Created attachment 182117 [details] [review]
Proposed patch

Here's an updated patch. Changes from previous patch

 - Write an explanatory commit message describe why this change is
   needed as well as what the change entails

 - Force refreshing events when opening the calendar dropdown to
   possibly work around buggy e-d-s code (I observed a couple of
   times, on login, that no events were loaded) and to reactivate
   the helper process in the event it crashes (guards against
   buggy e-d-s code and buggy helper code)

Please review. Thanks!
Comment 7 Colin Walters 2011-02-28 19:37:01 UTC
src/Makefile-calendar-server.am
5	 
6	$(service_DATA): $(service_in_files) Makefile
7	@sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
	
I rather religiously do:
$< > $@.tmp && mv $@.tmp $@
On ext4 and BTRFS this is guaranteed to be "atomic".
src/gnome-shell.in
255	subprocess.Popen([calendar_server_path])
256	except OSError, e:
257	print "Failed to start %s: %s"% (calendar_server_path, e)
	
Please start this from say shell-global.c; there are incoming patches to massively trim down and sanitize this script.
Comment 8 Colin Walters 2011-02-28 19:37:43 UTC
The C code looks superficially fine; I'm not familiar with the evo APIs, so I can't do a full review.  Fine to commit after the above comments are addressed.
Comment 9 David Zeuthen (not reading bugmail) 2011-02-28 21:05:06 UTC
Created attachment 182123 [details] [review]
Updated patch

Updated patch fixing the issues mentioned in comment 7 and comment 8. I will push this to master momentarily.
Comment 10 David Zeuthen (not reading bugmail) 2011-02-28 21:10:39 UTC
Pushed as

 http://git.gnome.org/browse/gnome-shell/commit/?id=e9e30138bd617a410a60b45ac0a5576094ed63d4