Stop waiting for method response when browser disconnects

Bug #1616501 reported by Mike Rylander on 2016-08-24
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Medium
Unassigned
3.1
Medium
Unassigned
3.2
Medium
Unassigned
OpenSRF
Wishlist
Unassigned

Bug Description

When inside mod_perl, and the client disconnects, we should stop trying to receive results from a request. This will help prevent apache backend pile-ups when a cat sits on the Enter key at an OPAC computer.

Branch at: http://git.evergreen-ils.org/?p=working/OpenSRF.git;a=shortlog;h=refs/heads/user/miker/give-up-at-browser_stop

Mike Rylander (mrylander) wrote :
Changed in evergreen:
milestone: none → 2.next
Galen Charlton (gmc) wrote :

Using %ENV to pass the request object around won't work for Perl 5.18 and later, as stuff assigned to %ENV gets immediately stringified:

http://perldoc.perl.org/perlvar.html#%25ENV

It worked prior to 5.18 because the stringification used to happen only when passing the environment to child processes.

An alternative would be ensuring that +GlobalRequest is turned on for /eg, which in turn would allow use of Apache2::RequestUtil->request (although per bug 1579219 I at least would prefer that the check be wrapped well enough so that mod_perl remains an optional dependency for OpenSRF :) )

Removing pullrequest for now.

tags: removed: pullrequest
Mike Rylander (mrylander) wrote :

Ah! Thanks, modern perl.

In that case, I think it's simplest (both in code and in administrator effort) to use an OpenSRF.pm package-local variable wrapped in an API to accept a request-looking object, rather than requiring OpenSRF to include Apache2::RequestUtil. We just got rid of mod_perl as a dep ... :)

Thoughts on that alternative?

Mike Rylander (mrylander) wrote :

I've updated the two branches linked above to make that happen. Note that using an API means that Evergreen requires a supporting OpenSRF, instead of silently degrading to the old behavior as setting ENV (or another variable) would allow.

Galen Charlton (gmc) on 2017-02-17
tags: added: pullrequest
Galen Charlton (gmc) on 2017-02-21
Changed in opensrf:
milestone: 2.5-alpha → 2.5-beta
Galen Charlton (gmc) wrote :

I've pushed the (squashed) patches to OpenSRF for inclusion in 2.5-beta. Thanks, Mike! I'll continue testing the Evergreen side as a potential candidate bugfix for Evergreen 2.12-rc.

Changed in opensrf:
status: New → Fix Committed
Galen Charlton (gmc) on 2017-02-22
Changed in opensrf:
status: Fix Committed → Fix Released
Dan Wells (dbw2) on 2018-02-13
Changed in evergreen:
milestone: 3.next → 3.1-beta
Dan Wells (dbw2) on 2018-02-14
Changed in evergreen:
status: New → Confirmed
importance: Undecided → Medium
Changed in evergreen:
milestone: 3.1-beta → 3.1-rc
Changed in evergreen:
milestone: 3.1-rc → 3.1.1
Changed in evergreen:
milestone: 3.1.1 → 3.1.2
Changed in evergreen:
milestone: 3.1.2 → 3.1.3
Changed in evergreen:
milestone: 3.1.3 → 3.1.4
Changed in evergreen:
milestone: 3.1.4 → 3.1.5
Changed in evergreen:
milestone: 3.1.5 → 3.1.6
Changed in evergreen:
milestone: 3.1.6 → 3.2.1
milestone: 3.2.1 → 3.1.7

Bumping to 3.2.2 so it is not lost there. It should be backported to Evergreen 3.1. also, but since this is an OpenSRF bug, we can apparently only target 1 Evergreen milestone in the Evergreen portion.

Changed in evergreen:
milestone: 3.1.7 → 3.1.8
milestone: 3.1.8 → 3.2.2
Chris Sharp (chrissharp123) wrote :

Seeing this error when doing a bib search after applying this patch over current Evergreen master on OpenSRF master:

2018-11-06 11:00:22 csharp-master-xenial gateway: [ERR :28889:Search.pm:466:15415199542888913] multiclass search error: Can't locate object method "aborted" via package "Apache2::Connection" at /usr/local/share/perl/5.22.1/OpenSRF/Transport/SlimJabber/XMPPReader.pm line 228.
2018-11-06 11:00:42 csharp-master-xenial gateway: [perl:error] [pid 28892] [client ::1:58072] egweb: Context Loader error: Can't locate object method "aborted" via package "Apache2::Connection" at /usr/local/share/perl/5.22.1/OpenSRF/Transport/SlimJabber/XMPPReader.pm line 228.\n, referer: https://csharp-master.gapines.org/eg/opac/results?query=sd&qtype=keyword&fi%3Asearch_format=&locg=1&detail_record_view=0&_adv=1&sort=

Changed in evergreen:
milestone: 3.2.2 → 3.2.3
Changed in evergreen:
milestone: 3.2.3 → 3.2.4
Changed in evergreen:
milestone: 3.2.4 → 3.2.5
Changed in evergreen:
milestone: 3.2.5 → 3.2.6
Changed in evergreen:
milestone: 3.2.6 → 3.2.7
Mike Rylander (mrylander) wrote :

Chris,

Based on the error message, it looks like you're using a mod_perl from the 1.x series, which doesn't have an aborted() method in Apache2::Connection. Looks like that showed up with version 2.0.0. Can you confirm your Apache2 (perl module) and mod_perl versions?

Thanks!

Chris Sharp (chrissharp123) wrote :

Well, after installing your commits atop Evergreen master running on OpenSRF master on Ubuntu 16.04 (Apache 2.4.18/mod_perl version 2.0.9), I'm not seeing the errors. I don't know what was different back in November when I tested before, but I don't see a problem with this so far in my testing. I'll poke it some more and sign off as soon as I'm satisfied that everything looks fine.

Changed in evergreen:
assignee: nobody → Chris Sharp (chrissharp123)
Changed in evergreen:
assignee: Chris Sharp (chrissharp123) → nobody
Changed in evergreen:
milestone: 3.2.7 → 3.3.3
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers