Skip Menu |

This queue is for tickets about the Net-Appliance-Session CPAN distribution.

Report information
The Basics
Id: 53796
Status: resolved
Priority: 0/
Queue: Net-Appliance-Session

People
Owner: OLIVER [...] cpan.org
Requestors: Steve.Campbell [...] virginmedia.co.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Deep recursion in Net::Appliance::Session 1.36
Date: Mon, 18 Jan 2010 15:45:07 -0000
To: bug-Net-Appliance-Session [...] rt.cpan.org
From: "Campbell, Steve" <Steve.Campbell [...] virginmedia.co.uk>
Hi, I've come across a replicatable error message as follows: "Deep recursion on subroutine "Net::Appliance::Session::cmd" at /opt/perllib/Net/Appliance/Session/Engine.pm line 37. " I get this when running a command which generates a huge amount of output, after disabling paging. What is happening is that the command is timing out, and the eval in Net::Telnet::waitfor() is calling close(). The close calls enable_paging(). Enable_paging() calls cmd() with the paging command. Cmd() calls waitfor() This fails as the device hasn't finished the original command yet. The eval then calls close() and we go into a death spiral. The fix is add the accessor close_called, and add the following lines to close() - # Ensure we don't go into a loop if the clean up commands fail. return if $self->close_called; $self->close_called(1); The original command still fails, but at least we now get a meaningful time out message! Next things I'm looking are to fix waitfor() such that * Pattern matches are only done on the last line of output, to avoid performance costs going exponential with large command outputs. Hmm. This got reported and rejected in 2003. * Reset the timeout clock whenever it receives more data * Allow waitfor to squirt out the data as it gets it, instead of having to wait until the command ends. Of course, these aren't your concern, but you might be interested... Thanks, Steve ------------------------------------------------------------------------------ Save Paper - Do you really need to print this e-mail? Visit www.virginmedia.com for more information, and more fun. This email and any attachments are or may be confidential and legally privileged and are sent solely for the attention of the addressee(s). If you have received this email in error, please delete it from your system: its use, disclosure or copying is unauthorised. Statements and opinions expressed in this email may not represent those of Virgin Media. Any representations or commitments in this email are subject to contract. Please note that we are migrating our email addresses to a company wide address of "@virginmedia.co.uk". If you are sending to a Telewest or ntl email address your email will be re-directed. Registered office: 160 Great Portland Street, London W1W 5QA. Registered in England and Wales with number 2591237 ==============================================================================
Subject: Re: [rt.cpan.org #53796] Deep recursion in Net::Appliance::Session 1.36
Date: Mon, 18 Jan 2010 16:17:56 +0000
To: bug-Net-Appliance-Session [...] rt.cpan.org
From: Oliver Gorwits <oliver.gorwits [...] oucs.ox.ac.uk>
Hi Steve, On 18/01/2010 15:45, Campbell, Steve via RT wrote: Show quoted text
> The original command still fails, but at least we now get a meaningful > time out message!
Many thanks for the report, I'll look to fold that change back into a new release. Show quoted text
> Next things I'm looking are to fix waitfor() such that
<snip> Show quoted text
> Of course, these aren't your concern, but you might be interested...
As it happens I'm very interested, as in the last week or so I started to re-write the module from the groud up, so it's interesting to know what features people use or would like to see. The new version will likely have an incompatible API and will not be released for some time, so I'm not suggesting that you stop work on the current Net::Appliance::Session. Thanks once again for the feedback, and do keep in touch, regards, -- Oliver Gorwits, Network and Telecommunications Group, Oxford University Computing Services
Hi Steve, Oh dear, nearly a year in responding. I'm very sorry :( On Mon Jan 18 10:45:55 2010, Steve.Campbell@virginmedia.co.uk wrote: Show quoted text
> The fix is add the accessor close_called, and add the following lines > to close() - > > # Ensure we don't go into a loop if the clean up commands fail. > return if $self->close_called; > $self->close_called(1);
Super, thanks! I'll include this in the next release shortly to hit CPAN. Show quoted text
> Next things I'm looking are to fix waitfor() such that > * Pattern matches are only done on the last line of output, to avoid > performance costs going exponential with large command outputs. Hmm. > This got reported and rejected in 2003.
I presume you mean reported against Net::Telnet ? Yeah I'm still working on a new version of this module to ditch that and switch to something else. Thanks for the heads-up on this behaviour though, it helps me answer another separate ticket. regards, oliver.
Subject: RE: [rt.cpan.org #53796] Deep recursion in Net::Appliance::Session 1.36
Date: Tue, 4 Jan 2011 10:53:38 -0000
To: <bug-Net-Appliance-Session [...] rt.cpan.org>
From: "Campbell, Steve" <Steve.Campbell [...] virginmedia.co.uk>
Oliver, I'm very glad you did take a while as we discovered over Christmas that my patch has a serious flaw! I'll open a bug report to fix my bug! Thanks, Steve Show quoted text
-----Original Message----- From: Oliver Gorwits via RT [mailto:bug-Net-Appliance-Session@rt.cpan.org] Sent: 30 December 2010 21:11 To: Campbell, Steve Subject: [rt.cpan.org #53796] Deep recursion in Net::Appliance::Session 1.36 <URL: https://rt.cpan.org/Ticket/Display.html?id=53796 > Hi Steve, Oh dear, nearly a year in responding. I'm very sorry :( On Mon Jan 18 10:45:55 2010, Steve.Campbell@virginmedia.co.uk wrote:
> The fix is add the accessor close_called, and add the following lines > to close() - > > # Ensure we don't go into a loop if the clean up commands fail. > return if $self->close_called; > $self->close_called(1);
Super, thanks! I'll include this in the next release shortly to hit CPAN.
> Next things I'm looking are to fix waitfor() such that > * Pattern matches are only done on the last line of output, to avoid > performance costs going exponential with large command outputs. Hmm. > This got reported and rejected in 2003.
I presume you mean reported against Net::Telnet ? Yeah I'm still working on a new version of this module to ditch that and switch to something else. Thanks for the heads-up on this behaviour though, it helps me answer another separate ticket. regards, oliver. -------------------------------------------------------------------- Save Paper - Do you really need to print this e-mail? Visit www.virginmedia.com for more information, and more fun. This email and any attachments are or may be confidential and legally privileged and are sent solely for the attention of the addressee(s). If you have received this email in error, please delete it from your system: its use, disclosure or copying is unauthorised. Statements and opinions expressed in this email may not represent those of Virgin Media. Any representations or commitments in this email are subject to contract. Registered office: 160 Great Portland Street, London W1W 5QA. Registered in England and Wales with number 2591237