[Catalyst-commits] r11614 - in Catalyst-Devel/1.00/trunk: . lib/Catalyst

autarch at dev.catalyst.perl.org autarch at dev.catalyst.perl.org
Sun Oct 18 17:18:16 GMT 2009


Author: autarch
Date: 2009-10-18 17:18:15 +0000 (Sun, 18 Oct 2009)
New Revision: 11614

Modified:
   Catalyst-Devel/1.00/trunk/Changes
   Catalyst-Devel/1.00/trunk/lib/Catalyst/Restarter.pm
Log:
Fix the "eternally growing stack trace" problem with the restarter.

Added this to changes, and cleaned up Changes text for the other change in there.

Modified: Catalyst-Devel/1.00/trunk/Changes
===================================================================
--- Catalyst-Devel/1.00/trunk/Changes	2009-10-18 06:03:10 UTC (rev 11613)
+++ Catalyst-Devel/1.00/trunk/Changes	2009-10-18 17:18:15 UTC (rev 11614)
@@ -1,8 +1,11 @@
 This file documents the revision history for Perl extension Catalyst-Devel.
 
-        - Fix an issue with the Restarter in Win32 where @INC didn't get
-          passed along in "fork"
+        - The Restarter code cause stack traces for certain types of errors to
+          grow longer and longer with every restart. (Dave Rolsky)
 
+        - Fixed an issue with the Restarter in Win32 where @INC didn't get
+          passed along when restarting.
+
 1.20    2009-08-11 23:30:30
         - Bump required File::ChangeNotify version to 0.07. Closes RT#48610.
 

Modified: Catalyst-Devel/1.00/trunk/lib/Catalyst/Restarter.pm
===================================================================
--- Catalyst-Devel/1.00/trunk/lib/Catalyst/Restarter.pm	2009-10-18 06:03:10 UTC (rev 11613)
+++ Catalyst-Devel/1.00/trunk/lib/Catalyst/Restarter.pm	2009-10-18 17:18:15 UTC (rev 11614)
@@ -75,8 +75,14 @@
 sub _restart_on_changes {
     my $self = shift;
 
-    my @events = $self->_watcher->wait_for_events();
-    $self->_handle_events(@events);
+    # We use this loop in order to avoid having _handle_events() call back
+    # into this method. We used to do that, and the end result was that stack
+    # traces become longer and longer with every restart. Using the loop, the
+    # portion of the stack trace that covers this code never changes.
+    while (1) {
+        my @events = $self->_watcher->wait_for_events();
+        $self->_handle_events(@events);
+    }
 }
 
 sub _handle_events {
@@ -99,8 +105,6 @@
     $self->_kill_child;
 
     $self->_fork_and_start;
-
-    $self->_restart_on_changes;
 }
 
 sub DEMOLISH {




More information about the Catalyst-commits mailing list