Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
fixes for logout hang #592
A series of fixes for failure to logout, restart or shutdown, when an activity is hung. See the individual commits for narrative detail.
To cause a logout failure alert, start Terminal, then start
Other methods are to send SIGSTOP to any activity process.
Other test cases:
Add busy cursor methods, with a reference counter. Flush the cursor change to the display. Reduce the time between checks for journal ready. Why? - the busy cursor effect was not re-entrant; if the busy cursor was already in use it would not be restored, - a previous patch to add busy cursor on logout never worked properly because the cursor change was not flushed to the display, - the busy cursor should be removed as soon as practical once the journal is ready.
Add a cancel shutdown method to the session manager. Remove a delay before final shutdown. Why? - a cancel method is needed by a later patch to handle hung activities, - the one second delay before final shutdown is unnecessary, and makes Sugar feel unresponsive.
Add reference counted busy cursor methods, and flush the display. Why? - the busy cursor was delayed, because the change was not flushed, - a busy method will be useful for other delays in the control panel.
Add a quit failure alert to the menu and the control panel. After 30 seconds with no click, continue with the quit. Why? The buddy menu has options for shutdown, restart or logout. The control panel may also restart. These make Sugar quit. Session manager sends a save-yourself message to running activities, and waits for the activities to respond. When an activity does not respond, Sugar does not quit. No reason is given. Adding the alert will allow user to cancel the shutdown, cancel the control panel section change, and work the problem, or lose unsaved work. Caution: requires a patch to sugar-toolkit-gtk3:src/sugar3/graphics/alert.py otherwise a forced shutdown will occur 30 seconds after the alert is shown, even if Cancel is clicked.
Remove previous stacked alerts implementation. Remove alerts before changing zoom level. Fix button pressed callback to No code was using alerts in the homewindow. When it began to be used, changes to zoom level were ruining the ordering of children of self._box
Use ErrorAlert so that the Ok button need not be added. Connect before add to fit documented ordering. No actual effect.
This looks like a really good patch set. I have code reviewed it.
Otherwise it looks really good.
I'm not 100% sure on the alert implementation. I think that we are suffering from the fact that there is no way to push a critical alert to users in sugar and having to implement the alert in 100 places. There was the same issue with the max running activities patch from memory - it only displays alerts in the journal and home view.
The previously proposed solution was to show the alerts in activities by adding a new dbus api or something. But this did not get merged because it added a new api and that wasn't well received.
This is something we seriously need a design discussion about, but the design discussion is separate from this patch, which does everything consistently!
Thanks for the review.
You're right, there's a missing 'o.' on the end of the first paragraph, and a missing "." on the end of the last, but it is trivial, so please wait for others to review and me to agree before closing this pull request. I'd like to give everyone a chance to review.
Yes, because the control panel is invoked from the home view, and on an XO-1 the control panel steals more memory, causing any activities to take longer to respond to save-yourself message, since they will have to page fault to bring contents of virtual memory into physical memory.
I don't think this needs to be a comment or commit detail though.
I disagree, and would like other developers to give an opinion. @tchx84, @godiard? The problem with constants with only single point of use is that it takes longer for someone new to read the code and locate the constant declaration. I'm fine with constants that have multiple uses and are near to the code that uses them, but otherwise they waste valuable developer time. We want to be welcoming to new developers.
As you will have seen from your review, the implementation of alerts in Sugar is inconsistent. But beyond fixing the HomeWindow alert for this patch series, it didn't seem like a good time to embark on such a project.
I was happy to try to make the busy cursor more consistent, following the GSoC or GCI contributions, and this series does achieve some of that. But there are some more opportunities there as well.
Na looks fine. I'll merge it soon
On Tue, Oct 27, 2015, 11:41 AM James Cameron firstname.lastname@example.org