| 1 | package DBIO::PostgreSQL::EV::Pool; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | # ABSTRACT: EV::Pg connection pool for DBIO | ||||||||||||||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||||||||||||||
| 4 | 73 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 73 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | 73 | our $VERSION = '0.900007'; | |||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||
| 9 | 73 | ▶ | use base 'DBIO::Storage::PoolBase'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | 73 | ▶ | use IO::Poll (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 12 | 73 | ▶ | use POSIX (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | 73 | ▶ | use Scalar::Util (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 14 | 73 | ▶ | use Socket (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | 73 | ▶ | use DBIO::Util (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 16 | 73 | ▶ | use DBIO::PostgreSQL::EV::ConnectInfo qw( conninfo_string with_connect_timeout ); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 17 | 73 | ▶ | use DBIO::PostgreSQL::EV::Future (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||
| 21 | 648 | ▶ | sub _create_connection { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_create_connection: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | 648 | my ($self, $conninfo) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 23 | 648 | return $self->_create_ready_connection(conninfo => $conninfo); | |||||||||||||||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||
| 27 | 741 | ▶ | sub _new_connection { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_new_connection: called CC=2 SCAR=7.1
| |||||||||||||||||||||||||||||||||||||||||||
| 28 | 741 | my ($self, %args) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 29 | 741 | require EV::Pg; | |||||||||||||||||||||||||||||||||||||||||
| 30 | 741 | ▶ | return _pg_opened(_pg_new(%args)) unless ref $self; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||
| 32 | # Weak, like core's own on_connect / on_error: the handle keeps its handlers | ||||||||||||||||||||||||||||||||||||||||||
| 33 | # for as long as it lives, and the pool holds the handle. | ||||||||||||||||||||||||||||||||||||||||||
| 34 | 628 | my $on_error = $args{on_error}; | |||||||||||||||||||||||||||||||||||||||||
| 35 | 628 | my $pid = $$; | |||||||||||||||||||||||||||||||||||||||||
| 36 | 628 | my $weak_pg; | |||||||||||||||||||||||||||||||||||||||||
| 37 | 628 | Scalar::Util::weaken(my $weak_pool = $self); | |||||||||||||||||||||||||||||||||||||||||
| 38 | 33 | ▶ | $args{on_error} = sub { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=5 SCAR=19.4
| |||||||||||||||||||||||||||||||||||||||||||
| 39 | 33 | my ($pool, $pg) = ($weak_pool, $weak_pg); | |||||||||||||||||||||||||||||||||||||||||
| 40 | 33 | ▶ | $pool->_mark_connection_dead($pg) if $pool && $pg && $$ == $pid; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$pool and $pg and $$ == $pid
$pool and $pg
MC/DC0%0/3
$pool and $pg and $$ == $pid
$pool
$pg
$$ == $pid
Truth table25%1/4
A and B and C
A= $poolB= $pgC= $$ == $pid
| |||||||||||||||||||||||||||||||||||||||||||
| 41 | 33 | ▶ | $on_error->(@_) if $on_error; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 42 | 33 | return; | |||||||||||||||||||||||||||||||||||||||||
| 43 | 628 | }; | |||||||||||||||||||||||||||||||||||||||||
| 44 | 628 | my $pg = _pg_opened(_pg_new(%args)); | |||||||||||||||||||||||||||||||||||||||||
| 45 | 628 | Scalar::Util::weaken($weak_pg = $pg); | |||||||||||||||||||||||||||||||||||||||||
| 46 | 628 | return $pg; | |||||||||||||||||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||
| 49 | # EV::Pg->new, with no password in what it says (karr k78). What a handle | ||||||||||||||||||||||||||||||||||||||||||
| 50 | # says about its connection is libpq's text, and libpq quotes what it could | ||||||||||||||||||||||||||||||||||||||||||
| 51 | # not read: of a postgresql:// URI the whole of it, user:password@ included. | ||||||||||||||||||||||||||||||||||||||||||
| 52 | # That is the croak of the constructor -- libpq reads the conninfo before it | ||||||||||||||||||||||||||||||||||||||||||
| 53 | # connects -- which reaches the caller of a pooled statement and of listen; | ||||||||||||||||||||||||||||||||||||||||||
| 54 | # on_error hands on libpq's text as well. Both are masked here, the one place | ||||||||||||||||||||||||||||||||||||||||||
| 55 | # every handle of this distribution is made, the way core masks connect info | ||||||||||||||||||||||||||||||||||||||||||
| 56 | # in a message (DBIO::Util::mask_connect_secrets, core k297). The conninfo is | ||||||||||||||||||||||||||||||||||||||||||
| 57 | # not kept for it: on_error's text is masked by what is in it. An exception | ||||||||||||||||||||||||||||||||||||||||||
| 58 | # that is no string is rethrown as it came. | ||||||||||||||||||||||||||||||||||||||||||
| 59 | 741 | ▶ | sub _pg_new { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_pg_new: called CC=4 SCAR=14.1
| |||||||||||||||||||||||||||||||||||||||||||
| 60 | 741 | my (%args) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 61 | 741 | ▶ | $args{conninfo} = with_connect_timeout($args{conninfo}) if defined $args{conninfo}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 62 | 741 | ▶ | if (my $on_error = $args{on_error}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 63 | 35 | ▶ | $args{on_error} = sub { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 64 | 35 | $on_error->(DBIO::Util::mask_connect_secrets($_[0]), @_[1 .. $#_]); | |||||||||||||||||||||||||||||||||||||||||
| 65 | 35 | return; | |||||||||||||||||||||||||||||||||||||||||
| 66 | 739 | }; | |||||||||||||||||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||||||||||||||||
| 68 | 741 | my $pg; | |||||||||||||||||||||||||||||||||||||||||
| 69 | 741 | ▶ | return $pg if eval { $pg = EV::Pg->new(%args); 1 }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 70 | 0 | die DBIO::Util::mask_connect_secrets($@, [ $args{conninfo} ]); | |||||||||||||||||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||
| 73 | # --- Fork safety (karr k45) --------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||
| 74 | # See "Fork safety" in the POD. Private helpers are _pg_*: they share an | ||||||||||||||||||||||||||||||||||||||||||
| 75 | # inheritance chain with core's privates. | ||||||||||||||||||||||||||||||||||||||||||
| 76 | # | ||||||||||||||||||||||||||||||||||||||||||
| 77 | # Every handle _new_connection built that is alive in this process, by refaddr: | ||||||||||||||||||||||||||||||||||||||||||
| 78 | # [ the pid that opened it, the handle (weak) ]. The destructor removes its own | ||||||||||||||||||||||||||||||||||||||||||
| 79 | # entry. A plain hash rather than a per-pool list, so that the fork guard also | ||||||||||||||||||||||||||||||||||||||||||
| 80 | # reaches a handle the pool no longer counts -- one core dropped as inherited, | ||||||||||||||||||||||||||||||||||||||||||
| 81 | # say, which a statement still in flight keeps alive. | ||||||||||||||||||||||||||||||||||||||||||
| 82 | 73 | my %PG_OPENED; | |||||||||||||||||||||||||||||||||||||||||
| 83 | # Cancel requests out on a handle, by refaddr: { pid, close }. See | ||||||||||||||||||||||||||||||||||||||||||
| 84 | # _shutdown_connection. | ||||||||||||||||||||||||||||||||||||||||||
| 85 | my %PG_CANCEL; | ||||||||||||||||||||||||||||||||||||||||||
| 86 | 73 | my $PG_FORK_GUARD; | |||||||||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||||||||||
| 88 | 741 | ▶ | sub _pg_opened { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_pg_opened: called CC=2 SCAR=7.0
| |||||||||||||||||||||||||||||||||||||||||||
| 89 | 741 | my ($pg) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 90 | 741 | bless $pg, 'DBIO::PostgreSQL::EV::Pool::_Connection'; | |||||||||||||||||||||||||||||||||||||||||
| 91 | 741 | my $entry = [ $$, $pg ]; | |||||||||||||||||||||||||||||||||||||||||
| 92 | 741 | Scalar::Util::weaken($entry->[1]); | |||||||||||||||||||||||||||||||||||||||||
| 93 | 741 | $PG_OPENED{ Scalar::Util::refaddr($pg) } = $entry; | |||||||||||||||||||||||||||||||||||||||||
| 94 | 741 | ▶ | $PG_FORK_GUARD ||= _pg_fork_guard(); | ||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$PG_FORK_GUARD ||= _pg_fork_guard()
MC/DC0%0/2
$PG_FORK_GUARD ||= _pg_fork_guard()
$PG_FORK_GUARD
_pg_fork_guard()
Truth table66%2/3
A ||= B
A= $PG_FORK_GUARDB= _pg_fork_guard()
| |||||||||||||||||||||||||||||||||||||||||||
| 95 | 741 | return $pg; | |||||||||||||||||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||
| 98 | # One EV::fork watcher for every handle, armed with the first. EV runs fork | ||||||||||||||||||||||||||||||||||||||||||
| 99 | # watchers first thing when a child resumes the loop, before any I/O watcher, | ||||||||||||||||||||||||||||||||||||||||||
| 100 | # so the inherited handles are closed before they can read the parent's | ||||||||||||||||||||||||||||||||||||||||||
| 101 | # replies. keepalive(0): an active EV::fork watcher alone keeps EV::run from | ||||||||||||||||||||||||||||||||||||||||||
| 102 | # ever returning, and a guard must never be the reason the loop goes on | ||||||||||||||||||||||||||||||||||||||||||
| 103 | # running -- in the parent and in a child alike. It still fires after a fork. | ||||||||||||||||||||||||||||||||||||||||||
| 104 | 32 | ▶ | sub _pg_fork_guard { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_pg_fork_guard: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 105 | 32 | my $w = EV::fork(\&_pg_finish_inherited); | |||||||||||||||||||||||||||||||||||||||||
| 106 | 32 | $w->keepalive(0); | |||||||||||||||||||||||||||||||||||||||||
| 107 | 32 | return $w; | |||||||||||||||||||||||||||||||||||||||||
| 108 | } | ||||||||||||||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||||||||||||||
| 110 | 0 | ▶ | sub _pg_finish_inherited { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_pg_finish_inherited: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||||||||||||||||
| 111 | 0 | my @inherited = grep { $_->[0] != $$ } values %PG_OPENED; | |||||||||||||||||||||||||||||||||||||||||
| 112 | 0 | for my $entry (@inherited) { | |||||||||||||||||||||||||||||||||||||||||
| 113 | 0 | ▶ | my $pg = $entry->[1] or next; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 114 | 0 | local $@; | |||||||||||||||||||||||||||||||||||||||||
| 115 | 0 | eval { $pg->finish; 1 }; | |||||||||||||||||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||||||||||||||||
| 117 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||
| 120 | # In a process other than the one that opened $pg, point the file descriptor | ||||||||||||||||||||||||||||||||||||||||||
| 121 | # of its socket at /dev/null. libpq's close then writes its Terminate there -- | ||||||||||||||||||||||||||||||||||||||||||
| 122 | # send() fails on a non-socket -- and closes the child's descriptor only; the | ||||||||||||||||||||||||||||||||||||||||||
| 123 | # socket stays open in the parent, and the parent's session with it. /dev/null | ||||||||||||||||||||||||||||||||||||||||||
| 124 | # also keeps the descriptor number taken until libpq closes it, so nothing the | ||||||||||||||||||||||||||||||||||||||||||
| 125 | # child opens meanwhile can be closed in its place. Without /dev/null the | ||||||||||||||||||||||||||||||||||||||||||
| 126 | # descriptor is closed instead, which protects the parent all the same. A | ||||||||||||||||||||||||||||||||||||||||||
| 127 | # handle already closed has no socket (-1) and is left alone. | ||||||||||||||||||||||||||||||||||||||||||
| 128 | 1430 | ▶ | sub _pg_unshare { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_pg_unshare: called CC=5 SCAR=27.8
| |||||||||||||||||||||||||||||||||||||||||||
| 129 | 1430 | my ($pg) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 130 | 1430 | my $entry = $PG_OPENED{ Scalar::Util::refaddr($pg) }; | |||||||||||||||||||||||||||||||||||||||||
| 131 | 1430 | ▶ | return if !$entry || $entry->[0] == $$; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
not $entry or $entry->[0] == $$
MC/DC0%0/2
not $entry or $entry->[0] == $$
not $entry
$entry->[0] == $$
Truth table33%1/3
not(A) or B
A= not $entryB= $entry->[0] == $$
| |||||||||||||||||||||||||||||||||||||||||||
| 132 | 0 | my $fd = $pg->socket; | |||||||||||||||||||||||||||||||||||||||||
| 133 | 0 | ▶ | return if $fd < 0; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 134 | 0 | local $!; | |||||||||||||||||||||||||||||||||||||||||
| 135 | 0 | my $null = POSIX::open('/dev/null', POSIX::O_RDWR()); | |||||||||||||||||||||||||||||||||||||||||
| 136 | 0 | ▶ | if (defined $null) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 137 | 0 | POSIX::dup2($null, $fd); | |||||||||||||||||||||||||||||||||||||||||
| 138 | 0 | POSIX::close($null); | |||||||||||||||||||||||||||||||||||||||||
| 139 | } | ||||||||||||||||||||||||||||||||||||||||||
| 140 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 141 | 0 | POSIX::close($fd); | |||||||||||||||||||||||||||||||||||||||||
| 142 | } | ||||||||||||||||||||||||||||||||||||||||||
| 143 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 144 | } | ||||||||||||||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||||||||||||
| 146 | # The fork-safe handle: EV::Pg with the two ways it closes a connection taken | ||||||||||||||||||||||||||||||||||||||||||
| 147 | # over. Defined without a package statement, like | ||||||||||||||||||||||||||||||||||||||||||
| 148 | # DBIO::PostgreSQL::EV::Future::_Frame, and naming EV::Pg's methods | ||||||||||||||||||||||||||||||||||||||||||
| 149 | # explicitly: SUPER:: would resolve against this file's package. | ||||||||||||||||||||||||||||||||||||||||||
| 150 | 73 | @DBIO::PostgreSQL::EV::Pool::_Connection::ISA = ('EV::Pg'); | |||||||||||||||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||||||||||||||||
| 152 | 729 | ▶ | sub DBIO::PostgreSQL::EV::Pool::_Connection::finish { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
finish: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 153 | 729 | my ($pg) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 154 | 729 | _pg_unshare($pg); | |||||||||||||||||||||||||||||||||||||||||
| 155 | 729 | $pg->EV::Pg::finish; | |||||||||||||||||||||||||||||||||||||||||
| 156 | 729 | return; | |||||||||||||||||||||||||||||||||||||||||
| 157 | } | ||||||||||||||||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||||||||||||||||
| 159 | 701 | ▶ | sub DBIO::PostgreSQL::EV::Pool::_Connection::DESTROY { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
DESTROY: called CC=2 SCAR=7.0
| |||||||||||||||||||||||||||||||||||||||||||
| 160 | 701 | my ($pg) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 161 | 701 | _pg_unshare($pg); | |||||||||||||||||||||||||||||||||||||||||
| 162 | 701 | delete $PG_OPENED{ Scalar::Util::refaddr($pg) }; | |||||||||||||||||||||||||||||||||||||||||
| 163 | 701 | delete $PG_CANCEL{ Scalar::Util::refaddr($pg) }; | |||||||||||||||||||||||||||||||||||||||||
| 164 | # A stand-in EV::Pg in a test may have no destructor. | ||||||||||||||||||||||||||||||||||||||||||
| 165 | 701 | ▶ | $pg->EV::Pg::DESTROY if EV::Pg->can('DESTROY'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 166 | 701 | return; | |||||||||||||||||||||||||||||||||||||||||
| 167 | } | ||||||||||||||||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||||||||||||
| 170 | 88 | ▶ | sub _new_waiter { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_new_waiter: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 171 | 88 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 172 | 88 | my $waiter = $self->SUPER::_new_waiter; | |||||||||||||||||||||||||||||||||||||||||
| 173 | 88 | ▶ | $waiter->_queued_in($self) if $waiter->can('_queued_in'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 174 | 88 | return $waiter; | |||||||||||||||||||||||||||||||||||||||||
| 175 | } | ||||||||||||||||||||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||||||||||||||||
| 178 | 86 | ▶ | sub _pg_held_by_callbacks { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_pg_held_by_callbacks: called CC=8 SCAR=21.0
| |||||||||||||||||||||||||||||||||||||||||||
| 179 | 86 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 180 | 86 | ▶ | return 0 if $self->available; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 181 | 85 | ▶ | my @held = grep { defined } @{ $self->{_connections} || [] }; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$self->{'_connections'} || []
MC/DC0%0/1
$self->{'_connections'} || []
$self->{'_connections'}
Truth table50%1/2
A
A= $self->{'_connections'}
| |||||||||||||||||||||||||||||||||||||||||||
| 182 | 85 | ▶ | return 0 unless @held || $self->_pg_opening; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
@held or $self->_pg_opening
MC/DC0%0/2
@held or $self->_pg_opening
@held
$self->_pg_opening
Truth table66%2/3
A or B
A= @heldB= $self->_pg_opening
| |||||||||||||||||||||||||||||||||||||||||||
| 183 | 85 | for my $conn (@held) { | |||||||||||||||||||||||||||||||||||||||||
| 184 | 73 | ▶ | DBIO::PostgreSQL::EV::Future->_held_by_callback($conn) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
"DBIO::PostgreSQL::EV::Future"->_held_by_callback($conn) or "DBIO::PostgreSQL::EV::Future"->_held_by_spawn($conn)
MC/DC100%2/2
"DBIO::PostgreSQL::EV::Future"->_held_by_callback($conn) or "DBIO::PostgreSQL::EV::Future"->_held_by_spawn($conn)
"DBIO::PostgreSQL::EV::Future"->_held_by_callback($conn)
"DBIO::PostgreSQL::EV::Future"->_held_by_spawn($conn)
Truth table100%3/3
A or B
A= "DBIO::PostgreSQL::EV::Future"->_held_by_callback($conn)B= "DBIO::PostgreSQL::EV::Future"->_held_by_spawn($conn)
| |||||||||||||||||||||||||||||||||||||||||||
| 185 | or DBIO::PostgreSQL::EV::Future->_held_by_spawn($conn) | ||||||||||||||||||||||||||||||||||||||||||
| 186 | or return 0; | ||||||||||||||||||||||||||||||||||||||||||
| 187 | } | ||||||||||||||||||||||||||||||||||||||||||
| 188 | 36 | return 1; | |||||||||||||||||||||||||||||||||||||||||
| 189 | } | ||||||||||||||||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||||||||||||
| 192 | 36 | ▶ | sub _pg_opening { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_pg_opening: called CC=4 SCAR=14.3
| |||||||||||||||||||||||||||||||||||||||||||
| 193 | 36 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 194 | my $replaying = grep { | ||||||||||||||||||||||||||||||||||||||||||
| 195 | 14 | ▶ | defined && DBIO::PostgreSQL::EV::Future->_held_by_spawn($_) | ||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
defined $_ && 'DBIO::PostgreSQL::EV::Future'->_held_by_spawn($_)
MC/DC50%1/2
defined $_ && 'DBIO::PostgreSQL::EV::Future'->_held_by_spawn($_)
defined $_
'DBIO::PostgreSQL::EV::Future'->_held_by_spawn($_)
Truth table66%2/3
A && B
A= defined $_B= 'DBIO::PostgreSQL::EV::Future'->_held_by_spawn($_)
| |||||||||||||||||||||||||||||||||||||||||||
| 196 | 36 | ▶ | } @{ $self->{_connections} || [] }; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$self->{'_connections'} || []
MC/DC0%0/1
$self->{'_connections'} || []
$self->{'_connections'}
Truth table50%1/2
A
A= $self->{'_connections'}
| |||||||||||||||||||||||||||||||||||||||||||
| 197 | 36 | ▶ | return $replaying + keys %{ $self->{_spawning} || {} }; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$self->{'_spawning'} || {}
MC/DC0%0/1
$self->{'_spawning'} || {}
$self->{'_spawning'}
Truth table50%1/2
A
A= $self->{'_spawning'}
| |||||||||||||||||||||||||||||||||||||||||||
| 198 | } | ||||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||
| 200 | |||||||||||||||||||||||||||||||||||||||||||
| 201 | 8332 | ▶ | sub _idle_connection_alive { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_idle_connection_alive: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||||||||||||||||
| 202 | 8332 | my ($self, $pg) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 203 | 8332 | ▶ | return 0 unless $pg->is_connected; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 204 | 8325 | ▶ | return 1 if $pg->pending_count; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 205 | 8323 | ▶ | return $self->_pg_peer_closed($pg) ? 0 : 1; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 206 | } | ||||||||||||||||||||||||||||||||||||||||||
| 207 | |||||||||||||||||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||||||||||||||||
| 209 | 73 | my $PG_POLL_BROKEN = IO::Poll::POLLHUP() | IO::Poll::POLLERR() | IO::Poll::POLLNVAL(); | |||||||||||||||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||||||||||||||||
| 211 | 8361 | ▶ | sub _pg_peer_closed { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_pg_peer_closed: called CC=5 SCAR=16.1
| |||||||||||||||||||||||||||||||||||||||||||
| 212 | 8361 | my ($self, $pg) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 213 | 8361 | my $fd = $pg->socket; | |||||||||||||||||||||||||||||||||||||||||
| 214 | 8357 | ▶ | return 0 unless defined $fd && $fd >= 0; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $fd and $fd >= 0
MC/DC100%2/2
defined $fd and $fd >= 0
defined $fd
$fd >= 0
Truth table100%3/3
A and B
A= defined $fdB= $fd >= 0
| |||||||||||||||||||||||||||||||||||||||||||
| 215 | 8087 | ▶ | my $rdhup = _pg_rdhup() or return 0; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 216 | 8085 | ▶ | return _pg_poll($fd, $rdhup) & ($rdhup | $PG_POLL_BROKEN) ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 217 | } | ||||||||||||||||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||||||||||||||||
| 219 | |||||||||||||||||||||||||||||||||||||||||||
| 220 | 73 | my $PG_RDHUP; | |||||||||||||||||||||||||||||||||||||||||
| 221 | |||||||||||||||||||||||||||||||||||||||||||
| 222 | 8087 | ▶ | sub _pg_rdhup { $PG_RDHUP //= _pg_measure_rdhup() } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_pg_rdhup: called CC=2 SCAR=7.2
Condition66%2/3
$PG_RDHUP //= _pg_measure_rdhup()
MC/DC0%0/2
$PG_RDHUP //= _pg_measure_rdhup()
$PG_RDHUP
_pg_measure_rdhup()
Truth table66%2/3
A //= B
A= $PG_RDHUPB= _pg_measure_rdhup()
| |||||||||||||||||||||||||||||||||||||||||||
| 223 | |||||||||||||||||||||||||||||||||||||||||||
| 224 | 10 | ▶ | sub _pg_measure_rdhup { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_pg_measure_rdhup: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||||||||||||||||
| 225 | 10 | my $bit = 0x2000; | |||||||||||||||||||||||||||||||||||||||||
| 226 | 10 | local ($@, $!); | |||||||||||||||||||||||||||||||||||||||||
| 227 | 10 | my $measured = eval { | |||||||||||||||||||||||||||||||||||||||||
| 228 | 10 | ▶ | socketpair(my $near, my $far, Socket::AF_UNIX(), Socket::SOCK_STREAM(), Socket::PF_UNSPEC()) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 229 | or return 0; | ||||||||||||||||||||||||||||||||||||||||||
| 230 | 10 | my $fd = fileno $near; | |||||||||||||||||||||||||||||||||||||||||
| 231 | 10 | syswrite $far, 'x'; | |||||||||||||||||||||||||||||||||||||||||
| 232 | 10 | ▶ | return 0 if _pg_poll($fd, $bit) & $bit; # open, something to read | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 233 | 7 | close $far; | |||||||||||||||||||||||||||||||||||||||||
| 234 | 7 | _pg_poll($fd, $bit) & $bit; # closed behind it | |||||||||||||||||||||||||||||||||||||||||
| 235 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 236 | 10 | ▶ | return $measured || 0; | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$measured || 0
MC/DC100%1/1
$measured || 0
$measured
Truth table100%2/2
A
A= $measured
| |||||||||||||||||||||||||||||||||||||||||||
| 237 | } | ||||||||||||||||||||||||||||||||||||||||||
| 238 | |||||||||||||||||||||||||||||||||||||||||||
| 239 | # poll(2) on one descriptor, not waiting: the events it reports, 0 for none | ||||||||||||||||||||||||||||||||||||||||||
| 240 | # and when it failed. IO::Poll's XS half is called directly -- its object | ||||||||||||||||||||||||||||||||||||||||||
| 241 | # interface wants a filehandle, and all there is of libpq's socket is the | ||||||||||||||||||||||||||||||||||||||||||
| 242 | # descriptor. A zero timeout cannot wait, but the kernel answers EINTR for a | ||||||||||||||||||||||||||||||||||||||||||
| 243 | # pending signal when there is nothing to report, which says nothing about | ||||||||||||||||||||||||||||||||||||||||||
| 244 | # the socket: asked again. | ||||||||||||||||||||||||||||||||||||||||||
| 245 | 8102 | ▶ | sub _pg_poll { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_pg_poll: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||||||||||||||||
| 246 | 8102 | my ($fd, $events) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 247 | 8102 | local $!; | |||||||||||||||||||||||||||||||||||||||||
| 248 | 8102 | my ($found, @ask); | |||||||||||||||||||||||||||||||||||||||||
| 249 | 8102 | ▶ | do { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$found < 0 and $! == 4
MC/DC100%2/2
$found < 0 and $! == 4
$found < 0
$! == 4
Truth table100%3/3
A and B
A= $found < 0B= $! == 4
| |||||||||||||||||||||||||||||||||||||||||||
| 250 | 8106 | @ask = ($fd, $events); | |||||||||||||||||||||||||||||||||||||||||
| 251 | 8106 | $found = IO::Poll::_poll(0, @ask); | |||||||||||||||||||||||||||||||||||||||||
| 252 | } while ($found < 0 && $! == POSIX::EINTR()); | ||||||||||||||||||||||||||||||||||||||||||
| 253 | 8101 | ▶ | return $found > 0 ? $ask[1] : 0; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 254 | } | ||||||||||||||||||||||||||||||||||||||||||
| 255 | |||||||||||||||||||||||||||||||||||||||||||
| 256 | |||||||||||||||||||||||||||||||||||||||||||
| 257 | 645 | ▶ | sub _shutdown_connection { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_shutdown_connection: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||||||||||||||||
| 258 | 645 | my ($self, $conn) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 259 | 645 | ▶ | return unless defined $conn; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 260 | 645 | ▶ | return if !$self->{_shutdown} && _pg_close_after_cancel($conn); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
not $self->{"_shutdown"} and _pg_close_after_cancel($conn)
MC/DC100%2/2
not $self->{"_shutdown"} and _pg_close_after_cancel($conn)
not $self->{"_shutdown"}
_pg_close_after_cancel($conn)
Truth table100%3/3
not(A) and B
A= not $self->{"_shutdown"}B= _pg_close_after_cancel($conn)
| |||||||||||||||||||||||||||||||||||||||||||
| 261 | 635 | $conn->finish; | |||||||||||||||||||||||||||||||||||||||||
| 262 | } | ||||||||||||||||||||||||||||||||||||||||||
| 263 | |||||||||||||||||||||||||||||||||||||||||||
| 264 | # A connection retired with a statement in flight -- core drops the connection | ||||||||||||||||||||||||||||||||||||||||||
| 265 | # of a transaction, a pipeline or a deploy whose Future was cancelled (core | ||||||||||||||||||||||||||||||||||||||||||
| 266 | # k274) -- is closed AFTER the server has been asked to stop the statement. | ||||||||||||||||||||||||||||||||||||||||||
| 267 | # EV::Pg's finish drops a cancel_async request that is not through yet | ||||||||||||||||||||||||||||||||||||||||||
| 268 | # (PQcancelFinish), unsent: the statement then ran to its end on the server, | ||||||||||||||||||||||||||||||||||||||||||
| 269 | # measured 3 s for a pg_sleep(3), against 13 ms with the request answered | ||||||||||||||||||||||||||||||||||||||||||
| 270 | # first (karr k75). Returns true when the close is left to the answer. | ||||||||||||||||||||||||||||||||||||||||||
| 271 | # | ||||||||||||||||||||||||||||||||||||||||||
| 272 | # %PG_CANCEL has an entry, by refaddr, from the moment a request is sent -- | ||||||||||||||||||||||||||||||||||||||||||
| 273 | # by the statement's own cancel guard (Storage.pm _pg_cancel_guard), or here -- | ||||||||||||||||||||||||||||||||||||||||||
| 274 | # until it is answered; `close` is set when a retirement is waiting for it. | ||||||||||||||||||||||||||||||||||||||||||
| 275 | # The answer's callback holds the handle until then, so a connection nobody | ||||||||||||||||||||||||||||||||||||||||||
| 276 | # else holds is not destroyed (and its request with it) before the request is | ||||||||||||||||||||||||||||||||||||||||||
| 277 | # through. | ||||||||||||||||||||||||||||||||||||||||||
| 278 | 20 | ▶ | sub _pg_cancel_begin { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_pg_cancel_begin: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 279 | 20 | my ($pg) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 280 | 20 | $PG_CANCEL{ Scalar::Util::refaddr($pg) } = { pid => $$ }; | |||||||||||||||||||||||||||||||||||||||||
| 281 | 20 | return; | |||||||||||||||||||||||||||||||||||||||||
| 282 | } | ||||||||||||||||||||||||||||||||||||||||||
| 283 | |||||||||||||||||||||||||||||||||||||||||||
| 284 | # The request is answered, ($ok, $err) being what EV::Pg called back with: close | ||||||||||||||||||||||||||||||||||||||||||
| 285 | # the connection if a retirement asked for it meanwhile. A request that ended | ||||||||||||||||||||||||||||||||||||||||||
| 286 | # with the connection (EV::Pg's finish says "connection closed") has nothing | ||||||||||||||||||||||||||||||||||||||||||
| 287 | # left to close. | ||||||||||||||||||||||||||||||||||||||||||
| 288 | 18 | ▶ | sub _pg_cancel_end { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_pg_cancel_end: called CC=8 SCAR=21.0
| |||||||||||||||||||||||||||||||||||||||||||
| 289 | 18 | my ($pg, $ok, $err) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 290 | 18 | ▶ | return unless defined $pg; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 291 | 18 | my $rec = delete $PG_CANCEL{ Scalar::Util::refaddr($pg) }; | |||||||||||||||||||||||||||||||||||||||||
| 292 | 18 | ▶ | return unless $rec && $rec->{close} && $rec->{pid} == $$; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%4/6
$rec and $rec->{"close"} and $rec->{"pid"} == $$
$rec and $rec->{"close"}
MC/DC33%1/3
$rec and $rec->{"close"} and $rec->{"pid"} == $$
$rec
$rec->{"close"}
$rec->{"pid"} == $$
Truth table50%2/4
A and B and C
A= $recB= $rec->{"close"}C= $rec->{"pid"} == $$
| |||||||||||||||||||||||||||||||||||||||||||
| 293 | 8 | ▶ | return if !$ok && defined $err && $err eq 'connection closed'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
not $ok and defined $err and $err eq "connection closed"
not $ok and defined $err
MC/DC66%2/3
not $ok and defined $err and $err eq "connection closed"
not $ok
defined $err
$err eq "connection closed"
Truth table75%3/4
not(A) and B and C
A= not $okB= defined $errC= $err eq "connection closed"
| |||||||||||||||||||||||||||||||||||||||||||
| 294 | 6 | local $@; | |||||||||||||||||||||||||||||||||||||||||
| 295 | 6 | eval { $pg->finish; 1 }; | |||||||||||||||||||||||||||||||||||||||||
| 296 | 6 | return; | |||||||||||||||||||||||||||||||||||||||||
| 297 | } | ||||||||||||||||||||||||||||||||||||||||||
| 298 | |||||||||||||||||||||||||||||||||||||||||||
| 299 | 28 | ▶ | sub _pg_cancel_is_out { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_pg_cancel_is_out: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||||
| 300 | 28 | my ($pg) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 301 | 28 | my $rec = $PG_CANCEL{ Scalar::Util::refaddr($pg) }; | |||||||||||||||||||||||||||||||||||||||||
| 302 | 28 | ▶ | return $rec && $rec->{pid} == $$ ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$rec and $rec->{"pid"} == $$
MC/DC50%1/2
$rec and $rec->{"pid"} == $$
$rec
$rec->{"pid"} == $$
Truth table66%2/3
A and B
A= $recB= $rec->{"pid"} == $$
| |||||||||||||||||||||||||||||||||||||||||||
| 303 | } | ||||||||||||||||||||||||||||||||||||||||||
| 304 | |||||||||||||||||||||||||||||||||||||||||||
| 305 | 108 | ▶ | sub _pg_close_after_cancel { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_pg_close_after_cancel: called CC=8 SCAR=22.2
| |||||||||||||||||||||||||||||||||||||||||||
| 306 | 108 | my ($pg) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 307 | 108 | ▶ | return 0 unless $pg->can('cancel_async') && $pg->is_connected && $pg->pending_count; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%6/6
$pg->can("cancel_async") and $pg->is_connected and $pg->pending_count
$pg->can("cancel_async") and $pg->is_connected
MC/DC100%3/3
$pg->can("cancel_async") and $pg->is_connected and $pg->pending_count
$pg->can("cancel_async")
$pg->is_connected
$pg->pending_count
Truth table100%4/4
A and B and C
A= $pg->can("cancel_async")B= $pg->is_connectedC= $pg->pending_count
| |||||||||||||||||||||||||||||||||||||||||||
| 308 | # Not in pipeline mode: a request there stops the one statement the server | ||||||||||||||||||||||||||||||||||||||||||
| 309 | # is on, and the rest of the batch runs on -- the guard sends none either, | ||||||||||||||||||||||||||||||||||||||||||
| 310 | # and a pipeline whose exit failed is closed at once (t/64). | ||||||||||||||||||||||||||||||||||||||||||
| 311 | 10 | ▶ | return 0 if $pg->can('pipeline_status') && $pg->pipeline_status; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$pg->can("pipeline_status") and $pg->pipeline_status
MC/DC0%0/2
$pg->can("pipeline_status") and $pg->pipeline_status
$pg->can("pipeline_status")
$pg->pipeline_status
Truth table33%1/3
A and B
A= $pg->can("pipeline_status")B= $pg->pipeline_status
| |||||||||||||||||||||||||||||||||||||||||||
| 312 | 10 | my $addr = Scalar::Util::refaddr($pg); | |||||||||||||||||||||||||||||||||||||||||
| 313 | 10 | ▶ | if (_pg_cancel_is_out($pg)) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 314 | 0 | $PG_CANCEL{$addr}{close} = 1; | |||||||||||||||||||||||||||||||||||||||||
| 315 | 0 | return 1; | |||||||||||||||||||||||||||||||||||||||||
| 316 | } | ||||||||||||||||||||||||||||||||||||||||||
| 317 | 10 | _pg_cancel_begin($pg); | |||||||||||||||||||||||||||||||||||||||||
| 318 | 10 | ▶ | my $sent = eval { $pg->cancel_async(sub { _pg_cancel_end($pg, @_) }); 1 }; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 319 | 10 | ▶ | unless ($sent) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 320 | 0 | delete $PG_CANCEL{$addr}; | |||||||||||||||||||||||||||||||||||||||||
| 321 | 0 | return 0; | |||||||||||||||||||||||||||||||||||||||||
| 322 | } | ||||||||||||||||||||||||||||||||||||||||||
| 323 | 10 | $PG_CANCEL{$addr}{close} = 1; | |||||||||||||||||||||||||||||||||||||||||
| 324 | 10 | return 1; | |||||||||||||||||||||||||||||||||||||||||
| 325 | } | ||||||||||||||||||||||||||||||||||||||||||
| 326 | |||||||||||||||||||||||||||||||||||||||||||
| 327 | |||||||||||||||||||||||||||||||||||||||||||
| 328 | 646 | ▶ | sub _transform_conninfo { conninfo_string($_[1]) } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_transform_conninfo: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 329 | |||||||||||||||||||||||||||||||||||||||||||
| 330 | 73 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 331 | |||||||||||||||||||||||||||||||||||||||||||
| 332 | __END__ | ||||||||||||||||||||||||||||||||||||||||||