This queue is for tickets about the HTTP-Cache-Transparent CPAN distribution.

Report information
The Basics
Id:
80140
Status:
open
Priority:
Low/Low

People
Owner:
Nobody in particular
Requestors:
NHORNE [...] cpan.org
Cc:
AdminCc:

BugTracker
Severity:
Normal
Broken in:
1.0
Fixed in:
(no value)



Subject: Is HTTP::Cache::Transparent thread safe?
This program always fails if I include HTTP::Cache::Transparent, however if you comment out the call to HTTP::Cache::Transparent::init, it fails with: HTML::Form::parse: No $base_uri provided at /usr/local/share/perl/5.14.2/WWW/Mec hanize.pm line 2664. #!/usr/bin/perl -w use Parallel::Simple qw(prun); use HTTP::Cache::Transparent; use WWW::Mechanize::Cached::GZip; HTTP::Cache::Transparent::init( { BasePath => '/tmp/cache/http-cache-transparent', # Verbose => 1, NoUpdate => 60 * 60, MaxAge => 15 * 24} ) || die "cache: $!"; my $m1 = WWW::Mechanize->new(); my $m2 = WWW::Mechanize->new(); prun([\&doit, $m1], [\&doit, $m2]) || die(Parallel::Simple::errplus()); prun([\&doit, $m1], [\&doit, $m2]) || die(Parallel::Simple::errplus()); sub doit { my $m = shift; $m->back() || $m->get('http://www.google.com'); my %fields = ('f' => 'hello world'); my $r = $m->submit_form(form_number => 1, fields => \%fields); unless($r->is_success()) { die $r->status_line(); } unless($r->content() =~ /<html/i) { die "oops"; } print "done\n"; }
Subject: HTTP::Cache::Transparent is not thread safe
I have only limited experience with threads, and HTTP::Cache::Transparent was not written with threads in mind. So I think it is safe to assume that it is not thread safe.
On Thu Oct 25 14:20:50 2012, MATTIASH wrote:
Show quoted text
> I have only limited experience with threads, and HTTP::Cache::Transparent > was not written with threads in mind. So I think it is safe to assume > that it is not thread safe.
Ah. Might I suggest that you please note that in the BUGS section of the manual in case I forget and others need to know? -Nigel
On Thu Oct 25 15:18:29 2012, NHORNE wrote:
Show quoted text
> On Thu Oct 25 14:20:50 2012, MATTIASH wrote:
> > I have only limited experience with threads, and
HTTP::Cache::Transparent
Show quoted text
> > was not written with threads in mind. So I think it is safe to assume > > that it is not thread safe.
> > Ah. Might I suggest that you please note that in the BUGS section of > the manual in case I forget and others need to know? >
Done. Unfortunately, I made a new release a few minutes earlier, so the note can only be seen via github...


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.