Return-Path: X-Original-To: apmail-perl-modperl-archive@www.apache.org Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5FCA419AE7 for ; Thu, 21 Apr 2016 14:54:22 +0000 (UTC) Received: (qmail 24189 invoked by uid 500); 21 Apr 2016 14:54:21 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 24151 invoked by uid 500); 21 Apr 2016 14:54:21 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 24139 invoked by uid 99); 21 Apr 2016 14:54:21 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Apr 2016 14:54:21 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id B54E7C05EF for ; Thu, 21 Apr 2016 14:54:20 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -12.622 X-Spam-Level: X-Spam-Status: No, score=-12.622 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id J72HEdOb-XDo for ; Thu, 21 Apr 2016 14:54:18 +0000 (UTC) Received: from rcdn-iport-6.cisco.com (rcdn-iport-6.cisco.com [173.37.86.77]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id A5ECF5F3F0 for ; Thu, 21 Apr 2016 14:54:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=3291; q=dns/txt; s=iport; t=1461250457; x=1462460057; h=from:to:subject:date:message-id:references:in-reply-to: content-id:content-transfer-encoding:mime-version; bh=O6GQDHIgCb4zrhnStwj5KdirqFSSPooFYo74Ku43RsM=; b=OBHAFsrYpykaZcp+wwJ80iaqiehuEV5tKqRjPcY0nC8PpmjzhG+3Vlf4 1HSYTyLl8qBRT5qaziKF6bXLu9EJYYAeTg6iMV0Rw2fqTv6dWCgUcR3Ca 6rh4HTpaPE0hi53ZuZ4/KML2Jel83VY1t6U8u9dCwkdxXfYAT+/8qouwX E=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0D1AQAn6RhX/5BdJa1egziBUAa5aQENg?= =?us-ascii?q?XOGDgKBMTgUAQEBAQEBAWUnhEIBAQSBCQIBCBguMiUCBAESiCq/aAEBAQEBAQE?= =?us-ascii?q?BAQEBAQEBAQEaimyEDwsGAQYChWwFh3GGGnqJCgGOE4FmhE2IXY8sAR4BAUKCB?= =?us-ascii?q?BqBSmyHOggXH34BAQE?= X-IronPort-AV: E=Sophos;i="5.24,513,1454976000"; d="scan'208";a="96154831" Received: from rcdn-core-8.cisco.com ([173.37.93.144]) by rcdn-iport-6.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Apr 2016 14:54:09 +0000 Received: from XCH-RCD-017.cisco.com (xch-rcd-017.cisco.com [173.37.102.27]) by rcdn-core-8.cisco.com (8.14.5/8.14.5) with ESMTP id u3LEs93e004937 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Thu, 21 Apr 2016 14:54:09 GMT Received: from xch-aln-017.cisco.com (173.36.7.27) by XCH-RCD-017.cisco.com (173.37.102.27) with Microsoft SMTP Server (TLS) id 15.0.1104.5; Thu, 21 Apr 2016 09:54:08 -0500 Received: from xch-aln-017.cisco.com ([173.36.7.27]) by XCH-ALN-017.cisco.com ([173.36.7.27]) with mapi id 15.00.1104.009; Thu, 21 Apr 2016 09:54:08 -0500 From: "Frotz Fa'Atuai (ffaatuai)" To: =?iso-8859-1?Q?Andr=E9_Warnier_=28tomcat=29?= , "modperl@perl.apache.org" Subject: Re: close connection for request, but continue Thread-Topic: close connection for request, but continue Thread-Index: AQHRm9tPNtx6Y9zs/km5G6j+8v+hj5+UYhAA Date: Thu, 21 Apr 2016 14:54:08 +0000 Message-ID: References: <5718E58B.3030203@ice-sa.com> In-Reply-To: <5718E58B.3030203@ice-sa.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.5.6.150930 x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.19.133.108] Content-Type: text/plain; charset="iso-8859-1" Content-ID: <02B93FD6926A7B4A817C7D752011A692@emea.cisco.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Iosif: You will need: [] a background state storage location (database table with unique row ID; directory with unique ID which points to the state file). [] Your user-facing request page accepts the request, scheduled the work, responds with a page which auto-refreshes against the GUID which reports status of the background request. [] Your user-facing status page auto-refreshes to itself while the job is in motion. [] Your user-facing status page auto-refreshes to a "you're done; your results are here / have been mailed to you". Observations: [] My corporate business users can follow along with a 15 second auto-refresh (as long as the page clearly indicates an auto-refresh in 15 seconds). Count-down timers are probably better. [] My technical users close the pop-up tab after the first request (not caring for the intermediate status pages and knowing that the result has been accomplished or mailed to them). Asides: [] Some of our backend jobs take a long time (lots of data to grind through); these tend towards email status. [] The database-based queue view (assuming you're internally facing only) allows your support teams to observed queued jobs (things which will happen in the future), active jobs (things running right now on some machine), completed jobs (jobs which succeeded), failed jobs (jobs which did not succeed). Hopefully these implementation specifics and operational observations assist you as you take Andr=E9's excellent summary and put it all to work. -- Frotz EMAN Cisco Systems, Inc. On 2016/04/21, 07:36, "Andr=E9 Warnier (tomcat)" wrote: >On 21.04.2016 11:20, Iosif Fettich wrote: >> Dear mod_perl list, >> >> please consider my gratefulness for any hints/insight :) >> >> I'm trying to achieve the following: when there is an incoming request, >>I want to set a >> time limit in which an answer should be delivered to the client, no >>matter what. >> >> However, since the work triggered by the initial request (there is >>another request to >> other site involved) might take much longer than that time limit, I >>want that work to >> properly finish, despite the fact that the initial request was 'served' >>already. >> > >The "canonical" way to do this, would be something like >- the client sends the request to the server >- the server allocates a process (or thread or whatever) to process this >request >- this request-processing process "delegates" this browser request to >some other,=20 >independent-of-the-webserver process, which can take as long as necessary >to fulfill the=20 >(background part of) the request >- the request-processing process does not wait for the response or the >exit of that=20 >independent process, but returns a response right away to the client >browser (such as=20 >"Thank you for your request. It is being handled by our back-office. You >will receive an=20 >email when it's done.".) >- and then, as far as the webserver is concerned, this client request is >finished=20 >(cleanly), and the request-processing process can be re-allocated to some >other incoming=20 >request > >Optionally, you could provide a way for the client to periodically >enquire as to the=20 >advancement status of his request.