Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

-- WARNING: removed Linux::AIO support. go get IO::AIO 1.6 at least if

       you use webserver mode or reproxy files or do buffered uploads.
  • Loading branch information...
commit 76674e4afbb165a61121a0275991144bb1cdb671 1 parent 1556470
bradfitz authored
View
3  CHANGES
@@ -1,3 +1,6 @@
+ -- WARNING: removed Linux::AIO support. go get IO::AIO 1.6 at least if
+ you use webserver mode or reproxy files or do buffered uploads.
+
1.58: 2007-05-11
-- plugin reload support, if plugin supports it. plugin must implement
View
8 Makefile.PL
@@ -32,13 +32,7 @@ WriteMakefile(
'Test::More' => 0,
'File::Find' => 0,
'Time::HiRes' => 0,
- },
- dist => {
- CI => "cvs commit",
- RCS_LABEL => 'cvs tag RELEASE_$(VERSION_SYM)',
- SUFFIX => ".gz",
- DIST_DEFAULT => 'all tardist',
- COMPRESS => "gzip",
+ #'IO::AIO' => 1.6, # recommened.
},
(
View
15 lib/Perlbal.pm
@@ -870,7 +870,7 @@ sub MANAGE_server {
if ($key eq "aio_mode") {
return $mc->err("Unknown AIO mode") unless $val =~ /^none|linux|ioaio$/;
- return $mc->err("Linux::AIO not available") if $val eq "linux" && ! $Perlbal::OPTMOD_LINUX_AIO;
+ return $mc->err("Linux::AIO no longer supported") if $val eq "linux";
return $mc->err("IO::AIO not available") if $val eq "ioaio" && ! $Perlbal::OPTMOD_IO_AIO;
$Perlbal::AIO_MODE = $val;
return $mc->ok;
@@ -878,8 +878,6 @@ sub MANAGE_server {
if ($key eq "aio_threads") {
return $mc->err("Expected numeric parameter") unless $val =~ /^-?\d+$/;
- Linux::AIO::min_parallel($val)
- if $Perlbal::OPTMOD_LINUX_AIO;
IO::AIO::min_parallel($val)
if $Perlbal::OPTMOD_IO_AIO;
return $mc->ok;
@@ -1108,9 +1106,7 @@ sub daemonize {
# note that we're not in the foreground (for logging purposes)
$foreground = 0;
- # required before fork: (as of Linux::AIO 1.1, but may change)
- Linux::AIO::max_parallel(0)
- if $Perlbal::OPTMOD_LINUX_AIO;
+ # required before fork: (as of old Linux::AIO 1.1, still true?)
IO::AIO::max_parallel(0)
if $Perlbal::OPTMOD_IO_AIO;
@@ -1149,15 +1145,10 @@ sub run {
# number of AIO threads. the number of outstanding requests isn't
# affected by this
- Linux::AIO::min_parallel(3) if $Perlbal::OPTMOD_LINUX_AIO;
IO::AIO::min_parallel(3) if $Perlbal::OPTMOD_IO_AIO;
- # register Linux::AIO's pipe which gets written to from threads
+ # register IO::AIO pipe which gets written to from threads
# doing blocking IO
- if ($Perlbal::OPTMOD_LINUX_AIO) {
- Perlbal::Socket->AddOtherFds(Linux::AIO::poll_fileno() =>
- \&Linux::AIO::poll_cb)
- }
if ($Perlbal::OPTMOD_IO_AIO) {
Perlbal::Socket->AddOtherFds(IO::AIO::poll_fileno() =>
\&IO::AIO::poll_cb);
View
59 lib/Perlbal/AIO.pm
@@ -9,47 +9,18 @@ use strict;
use POSIX qw(ENOENT EACCES EBADF);
use Fcntl qw(SEEK_CUR SEEK_SET SEEK_END O_RDWR O_CREAT O_TRUNC);
-# Try and use IO::AIO or Linux::AIO, if it's around.
+# Try and use IO::AIO, if it's around.
BEGIN {
$Perlbal::OPTMOD_IO_AIO = eval "use IO::AIO 1.6 (); 1;";
- $Perlbal::OPTMOD_LINUX_AIO = eval "use Linux::AIO 1.71 (); 1;";
-
- # let's test if their Linux::AIO works on their platform. common for it not to.
- if ($Perlbal::OPTMOD_LINUX_AIO) {
- my $good = 0;
- Linux::AIO::aio_open("/tmp/$$-" . rand() . "-bogusdir/bogusfile-$$", O_RDWR|O_CREAT|O_TRUNC, 0, sub {
- $good = 1 if $_[0] < 0 && $! == ENOENT;
- });
- while (Linux::AIO::nreqs()) {
- my $rfd = "";
- vec ($rfd, Linux::AIO::poll_fileno(), 1) = 1;
- select $rfd, undef, undef, undef;
- Linux::AIO::poll_cb();
- }
- unless ($good) {
- # pretend that they don't have Linux::AIO, but only bitch at them if they don't have IO::AIO ...
- unless ($Perlbal::OPTMOD_IO_AIO) {
- warn("WARNING: Your installation of Linux::AIO doesn't work.\n".
- " You seem to have installed it without 'make test',\n".
- " or you ignored the failing tests. I'm going to ignore\n".
- " that you have it and proceed without async IO. The\n".
- " modern replacement to Linux::AIO is IO::AIO.\n");
- }
- $Perlbal::OPTMOD_LINUX_AIO = 0;
- }
- }
}
END {
- Linux::AIO::max_parallel(0)
- if $Perlbal::OPTMOD_LINUX_AIO;
IO::AIO::max_parallel(0)
if $Perlbal::OPTMOD_IO_AIO;
}
$Perlbal::AIO_MODE = "none";
$Perlbal::AIO_MODE = "ioaio" if $Perlbal::OPTMOD_IO_AIO;
-$Perlbal::AIO_MODE = "linux" if $Perlbal::OPTMOD_LINUX_AIO;
############################################################################
# AIO functions available to callers
@@ -60,9 +31,7 @@ sub aio_readahead {
aio_channel_push(get_chan(), $user_cb, sub {
my $cb = shift;
- if ($Perlbal::AIO_MODE eq "linux") {
- Linux::AIO::aio_readahead($fh, $offset, $length, $cb);
- } elsif ($Perlbal::AIO_MODE eq "ioaio") {
+ if ($Perlbal::AIO_MODE eq "ioaio") {
IO::AIO::aio_readahead($fh, $offset, $length, $cb);
} else {
$cb->();
@@ -75,9 +44,7 @@ sub aio_stat {
aio_channel_push(get_chan($file), $user_cb, sub {
my $cb = shift;
- if ($Perlbal::AIO_MODE eq "linux") {
- Linux::AIO::aio_stat($file, $cb);
- } elsif ($Perlbal::AIO_MODE eq "ioaio") {
+ if ($Perlbal::AIO_MODE eq "ioaio") {
IO::AIO::aio_stat($file, $cb);
} else {
stat($file);
@@ -92,13 +59,7 @@ sub aio_open {
aio_channel_push(get_chan($file), $user_cb, sub {
my $cb = shift;
- if ($Perlbal::AIO_MODE eq "linux") {
- Linux::AIO::aio_open($file, $flags, $mode, sub {
- my $fd = shift;
- my $fh = _fh_of_fd_mode($fd, $mode);
- $cb->($fh);
- });
- } elsif ($Perlbal::AIO_MODE eq "ioaio") {
+ if ($Perlbal::AIO_MODE eq "ioaio") {
IO::AIO::aio_open($file, $flags, $mode, $cb);
} else {
my $fh;
@@ -113,9 +74,7 @@ sub aio_unlink {
aio_channel_push(get_chan($file), $user_cb, sub {
my $cb = shift;
- if ($Perlbal::AIO_MODE eq "linux") {
- Linux::AIO::aio_unlink($file, $cb);
- } elsif ($Perlbal::AIO_MODE eq "ioaio") {
+ if ($Perlbal::AIO_MODE eq "ioaio") {
IO::AIO::aio_unlink($file, $cb);
} else {
my $rv = unlink($file);
@@ -133,9 +92,7 @@ sub aio_write {
aio_channel_push(get_chan(), $user_cb, sub {
my $cb = shift;
- if ($Perlbal::AIO_MODE eq "linux") {
- Linux::AIO::aio_write($fh, $offset, $length, $alist->[3], 0, $cb);
- } elsif ($Perlbal::AIO_MODE eq "ioaio") {
+ if ($Perlbal::AIO_MODE eq "ioaio") {
IO::AIO::aio_write($fh, $offset, $length, $alist->[3], 0, $cb);
} else {
my $old_off = sysseek($fh, 0, SEEK_CUR);
@@ -155,9 +112,7 @@ sub aio_read {
aio_channel_push(get_chan(), $user_cb, sub {
my $cb = shift;
- if ($Perlbal::AIO_MODE eq "linux") {
- Linux::AIO::aio_read($fh, $offset, $length, $alist->[3], 0, $cb);
- } elsif ($Perlbal::AIO_MODE eq "ioaio") {
+ if ($Perlbal::AIO_MODE eq "ioaio") {
IO::AIO::aio_read($fh, $offset, $length, $alist->[3], 0, $cb);
} else {
my $old_off = sysseek($fh, 0, SEEK_CUR);
View
4 t/40-ranges.t
@@ -4,7 +4,7 @@ use strict;
use Perlbal::Test;
use Perlbal::Test::WebServer;
use Perlbal::Test::WebClient;
-use Test::More tests => 47;
+use Test::More tests => 35;
my ($back_port) = start_webserver();
@@ -90,7 +90,7 @@ foreach my $meth (qw(http rp_file rp_url)) {
my @aios = ("-");
if ($meth eq "rp_file" || $meth eq "http") {
- @aios = qw(none linux ioaio);
+ @aios = qw(none ioaio);
}
foreach my $aio (@aios) {
Please sign in to comment.
Something went wrong with that request. Please try again.