Silence more spurious warnings (this one is a serious wtf)
Peter Rabbitson [Thu, 4 Feb 2016 09:30:30 +0000 (10:30 +0100)]
Seen in no-XS CI (e.g https://travis-ci.org/dbsrgits/dbix-class/jobs/106811389)
on all perls and too involved to diagnose properly given the tight schedule

Just go for a cop out

lib/DBIx/Class/Storage/DBI.pm

index d390dc6..cdfc942 100644 (file)
@@ -901,7 +901,24 @@ sub disconnect {
     #$self->_sql_maker(undef); # this may also end up being different
   };
 
-  if( $self->_dbh ) {
+  # FIXME FIXME FIXME
+  # Something is wrong with CAG - it seems to delay GC in PP mode
+  # If the below if() is changed to:
+  #
+  #   if( $self->_dbh ) {
+  #
+  # The the following will reproducibly warn as the weakref in a $txn_guard
+  # is *NOT* deallocated by the time the $txn_guard destructor runs at
+  # https://github.com/dbsrgits/dbix-class/blob/84efb6d7/lib/DBIx/Class/Storage/TxnScopeGuard.pm#L82
+  #
+  # perl -Ilib -e '
+  #   BEGIN { warn $ENV{CAG_USE_XS} = ( time % 2 ) };
+  #   use DBIx::Class::Schema;
+  #   my $s = DBIx::Class::Schema->connect("dbi:SQLite::memory:");
+  #   my $g = $s->txn_scope_guard;
+  #   $s->storage->disconnect
+  # '
+  if( $self->{_dbh} ) { # do not use accessor - see above
 
     $self->_do_connection_actions(disconnect_call_ => $_) for (
       ( $self->on_disconnect_call || () ),