Re: [Sugar-devel] [PATCH v4 sugar] Time out on registration process to prevent indefinite UI hang (SL#2289)
Excerpts from Simon Schampijer's message of Thu Mar 24 15:04:29 +0100 2011: PS: Filing bugs upstream will a) increase the chance they get fixed by someone else, b) avoid duplicate work by sharing test results and c) give both upstream and other downstreams a better overview of what's (known to be) broken. I think this time it was more efficient to use the ml to report upstream, since I wanted to gather the attention from the originator of the code and I doubted he would read all the bugs in the sugarlabs bug tracker. My note was targeted at filing bugs (just) downstream. This mailing list is public (and upstream), thus providing most of the benefits outlined above. Thanks for filing #2726! Sascha -- http://sascha.silbe.org/ http://www.infra-silbe.de/ signature.asc Description: PGP signature ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH v4 sugar] Time out on registration process to prevent indefinite UI hang (SL#2289)
Excerpts from Simon Schampijer's message of Wed Mar 23 21:05:56 +0100 2011: I lately see this error [1] when trying to connect to a schoolserver. Maybe you (or someone else) have an idea what the issue is. If I do construct the ServerProxy without the _TimeoutTransport the registration will continue. Python 2.7 changed public API. I've replied on the ticket. [1] http://dev.laptop.org/ticket/10776 PS: Filing bugs upstream will a) increase the chance they get fixed by someone else, b) avoid duplicate work by sharing test results and c) give both upstream and other downstreams a better overview of what's (known to be) broken. Sascha -- http://sascha.silbe.org/ http://www.infra-silbe.de/ signature.asc Description: PGP signature ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH v4 sugar] Time out on registration process to prevent indefinite UI hang (SL#2289)
On 03/24/2011 07:39 AM, Sascha Silbe wrote: Excerpts from Simon Schampijer's message of Wed Mar 23 21:05:56 +0100 2011: I lately see this error [1] when trying to connect to a schoolserver. Maybe you (or someone else) have an idea what the issue is. If I do construct the ServerProxy without the _TimeoutTransport the registration will continue. Python 2.7 changed public API. I've replied on the ticket. [1] http://dev.laptop.org/ticket/10776 Thank for fiddling that on out. PS: Filing bugs upstream will a) increase the chance they get fixed by someone else, b) avoid duplicate work by sharing test results and c) give both upstream and other downstreams a better overview of what's (known to be) broken. I think this time it was more efficient to use the ml to report upstream, since I wanted to gather the attention from the originator of the code and I doubted he would read all the bugs in the sugarlabs bug tracker. Regards, Simon ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH v4 sugar] Time out on registration process to prevent indefinite UI hang (SL#2289)
On 03/24/2011 10:04 AM, Simon Schampijer wrote: On 03/24/2011 07:39 AM, Sascha Silbe wrote: Excerpts from Simon Schampijer's message of Wed Mar 23 21:05:56 +0100 2011: I lately see this error [1] when trying to connect to a schoolserver. Maybe you (or someone else) have an idea what the issue is. If I do construct the ServerProxy without the _TimeoutTransport the registration will continue. Python 2.7 changed public API. I've replied on the ticket. [1] http://dev.laptop.org/ticket/10776 Thank for fiddling that on out. PS: Filing bugs upstream will a) increase the chance they get fixed by someone else, b) avoid duplicate work by sharing test results and c) give both upstream and other downstreams a better overview of what's (known to be) broken. I think this time it was more efficient to use the ml to report upstream, since I wanted to gather the attention from the originator of the code and I doubted he would read all the bugs in the sugarlabs bug tracker. Regards, Simon Opened http://bugs.sugarlabs.org/ticket/2726 for tracking it. Regards, Simon ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH v4 sugar] Time out on registration process to prevent indefinite UI hang (SL#2289)
On 09/20/2010 10:45 AM, Dipankar Patro wrote: Registration with the school server is currently done synchronously. To prevent the UI from hanging indefinitely, if the school server is reachable but unresponsive, we add an explicit timeout. --- Hi Dipankar, I lately see this error [1] when trying to connect to a schoolserver. Maybe you (or someone else) have an idea what the issue is. If I do construct the ServerProxy without the _TimeoutTransport the registration will continue. Regards, Simon [1] http://dev.laptop.org/ticket/10776 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH v4 sugar] Time out on registration process to prevent indefinite UI hang (SL#2289)
Hi Simon, When I was working on the issue, I was using an emulator on Ubuntu to run Sugar (USR). Is the problem occurring on a XO? The only reason to use the TimeoutTransport here is to add a timeout with registration server connection process, which was not there before. The problem seems to be related to library 'httplib'. Let me check out on that. Regards, Dipankar On Thu, Mar 24, 2011 at 1:35 AM, Simon Schampijer si...@schampijer.dewrote: On 09/20/2010 10:45 AM, Dipankar Patro wrote: Registration with the school server is currently done synchronously. To prevent the UI from hanging indefinitely, if the school server is reachable but unresponsive, we add an explicit timeout. --- Hi Dipankar, I lately see this error [1] when trying to connect to a schoolserver. Maybe you (or someone else) have an idea what the issue is. If I do construct the ServerProxy without the _TimeoutTransport the registration will continue. Regards, Simon [1] http://dev.laptop.org/ticket/10776 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH v4 sugar] Time out on registration process to prevent indefinite UI hang (SL#2289)
Excerpts from James Cameron's message of Tue Oct 12 00:30:25 +0200 2010: I see no ack. I see no commit. This has been pushed to master on 2010-10-15 as ba20b1c by Tomeu and to sucrose-0.90 on 2010-10-26 as f297de2 by Simon. Sascha -- http://sascha.silbe.org/ http://www.infra-silbe.de/ signature.asc Description: PGP signature ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH v4 sugar] Time out on registration process to prevent indefinite UI hang (SL#2289)
On 09/21/2010 02:46 AM, James Cameron wrote: On Mon, Sep 20, 2010 at 08:15:59PM +0530, Dipankar Patro wrote: Registration with the school server is currently done synchronously. To prevent the UI from hanging indefinitely, if the school server is reachable but unresponsive, we add an explicit timeout. --- src/jarabe/desktop/schoolserver.py | 27 --- 1 files changed, 24 insertions(+), 3 deletions(-) v2 was Reviewed-By: Sascha Silbesascha-pgp at silbe.org v3 was Reviewed-By: Sascha Silbesascha-pgp at silbe.org v3-v4: Rebased on current mainline/master Reviewed-By: James Cameronqu...@laptop.org This one has been ack'ed right? I can find no commit. As we have discovered those two bugs maybe we should land it in 0.90.1 and of course master? http://bugs.sugarlabs.org/ticket/2432 http://bugs.sugarlabs.org/ticket/2289 Regards, Simon ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH v4 sugar] Time out on registration process to prevent indefinite UI hang (SL#2289)
On Mon, Oct 11, 2010 at 08:39:12PM +0200, Simon Schampijer wrote: On 09/21/2010 02:46 AM, James Cameron wrote: On Mon, Sep 20, 2010 at 08:15:59PM +0530, Dipankar Patro wrote: Registration with the school server is currently done synchronously. To prevent the UI from hanging indefinitely, if the school server is reachable but unresponsive, we add an explicit timeout. --- src/jarabe/desktop/schoolserver.py | 27 --- 1 files changed, 24 insertions(+), 3 deletions(-) v2 was Reviewed-By: Sascha Silbesascha-pgp at silbe.org v3 was Reviewed-By: Sascha Silbesascha-pgp at silbe.org v3-v4: Rebased on current mainline/master Reviewed-By: James Cameronqu...@laptop.org This one has been ack'ed right? I can find no commit. I see no ack. I see no commit. http://patchwork.sugarlabs.org/patch/260/ has the two reviewed-by tags. As we have discovered those two bugs maybe we should land it in 0.90.1 and of course master? I see no significant reason why this should not be fixed for 0.90.1. Insignificant reasons are use of undocumented internals and the way that the port argument to TimeoutHTTP is checked without obvious reason. -- James Cameron http://quozl.linux.org.au/ ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] [PATCH v4 sugar] Time out on registration process to prevent indefinite UI hang (SL#2289)
Registration with the school server is currently done synchronously. To prevent the UI from hanging indefinitely, if the school server is reachable but unresponsive, we add an explicit timeout. --- src/jarabe/desktop/schoolserver.py | 27 --- 1 files changed, 24 insertions(+), 3 deletions(-) v2 was Reviewed-By: Sascha Silbe sascha-pgp at silbe.org v3 was Reviewed-By: Sascha Silbe sascha-pgp at silbe.org v3-v4: Rebased on current mainline/master diff --git a/src/jarabe/desktop/schoolserver.py b/src/jarabe/desktop/schoolserver.py index a05f56c..69113ee 100644 --- a/src/jarabe/desktop/schoolserver.py +++ b/src/jarabe/desktop/schoolserver.py @@ -16,8 +16,9 @@ import logging from gettext import gettext as _ -from xmlrpclib import ServerProxy, Error +import xmlrpclib import socket +import httplib import os from string import ascii_uppercase import random @@ -30,6 +31,7 @@ from sugar import env from sugar.profile import get_profile REGISTER_URL = 'http://schoolserver:8080/' +REGISTER_TIMEOUT = 8 def generate_serial_number(): Generates a serial number based on 3 random uppercase letters @@ -76,6 +78,25 @@ def store_identifiers(serial_number, uuid, backup_url): class RegisterError(Exception): pass + +class TimeoutHTTP(httplib.HTTP): + +def __init__(self, host='', port=None, strict=None, timeout=None): +if port == 0: +port = None +# FIXME: Depending on undocumented internals that can break between +# Python releases. Please have a look at SL #2350 +self._setup(self._connection_class(host, + port, strict, timeout=REGISTER_TIMEOUT)) + + +class TimeoutTransport(xmlrpclib.Transport): + +def make_connection(self, host): +host, extra_headers, x509 = self.get_host_info(host) +return TimeoutHTTP(host, timeout=REGISTER_TIMEOUT) + + def register_laptop(url=REGISTER_URL): profile = get_profile() @@ -96,10 +117,10 @@ def register_laptop(url=REGISTER_URL): nick = client.get_string('/desktop/sugar/user/nick') -server = ServerProxy(url) +server = xmlrpclib.ServerProxy(url, TimeoutTransport()) try: data = server.register(sn, nick, uuid_, profile.pubkey) -except (Error, TypeError, socket.error): +except (xmlrpclib.Error, TypeError, socket.error): logging.exception('Registration: cannot connect to server') raise RegisterError(_('Cannot connect to the server.')) -- 1.7.0.4 ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH v4 sugar] Time out on registration process to prevent indefinite UI hang (SL#2289)
Excerpts from Dipankar Patro's message of Mon Sep 20 16:45:59 +0200 2010: v3-v4: Rebased on current mainline/master Reviewed-By: Sascha Silbe sascha-...@silbe.org Sascha -- http://sascha.silbe.org/ http://www.infra-silbe.de/ signature.asc Description: PGP signature ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] [PATCH v4 sugar] Time out on registration process to prevent indefinite UI hang (SL#2289)
On Mon, Sep 20, 2010 at 08:15:59PM +0530, Dipankar Patro wrote: Registration with the school server is currently done synchronously. To prevent the UI from hanging indefinitely, if the school server is reachable but unresponsive, we add an explicit timeout. --- src/jarabe/desktop/schoolserver.py | 27 --- 1 files changed, 24 insertions(+), 3 deletions(-) v2 was Reviewed-By: Sascha Silbe sascha-pgp at silbe.org v3 was Reviewed-By: Sascha Silbe sascha-pgp at silbe.org v3-v4: Rebased on current mainline/master Reviewed-By: James Cameron qu...@laptop.org -- James Cameron http://quozl.linux.org.au/ ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel