Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Store-CouchDB CPAN distribution.

Report information
The Basics
Id: 79570
Status: resolved
Priority: 0/
Queue: Store-CouchDB

People
Owner: Nobody in particular
Requestors: jnewman [...] capalon.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 1.11
  • 1.3
  • 1.4
  • 1.5
  • 1.7
  • 2.0
  • 2.1
  • 2.2
Fixed in: (no value)



Subject: UserAgent timeout
Thank you so much for Store::CouchDB. It works great! Currently, there is no way (code-hacking aside) to set the LWP::UserAgent->timeout() value. Could you please add a config parameter that will, in _call, work like this: my $timeout = $self->timeout; $ua->timeout($timeout); Or, as an (untested) patch: diff -uNr Store/CouchDB.pm Store.patched/CouchDB.pm --- Store/CouchDB.pm 2012-02-20 21:21:06.000000000 -0600 +++ Store.patched/CouchDB.pm 2012-09-11 07:16:59.558633564 -0500 @@ -97,6 +97,10 @@ is => 'rw', default => sub { 5000 }); +has 'timeout' => ( + is => 'rw', + default => '30'); + =head1 FUNCTIONS =head2 new @@ -666,6 +670,8 @@ if ($content); my $ua = LWP::UserAgent->new(); + my $timeout = $self->timeout; + $ua->timeout($ua); $ua->default_header('Content-Type' => "application/json"); my $res = $ua->request($req); This will allow it to timeout more quickly in the event of a failure than the LWP::UserAgent default of 180s. (I'd call this a wishlist item if the default wasn't currently 3 minutes...) Note that I'm proposing to impose a more sane default of 30s, but obviously that's up to you. Many thanks! -jbn (on IRC as jbnewman)
fixed in 2.3 cheers lenz