Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: PANIC: underlying join failed threded tcp server

by BrowserUk (Pope)
on Oct 17, 2012 at 21:22 UTC ( #999610=note: print w/ replies, xml ) Need Help??


in reply to PANIC: underlying join failed threded tcp server

Try replacing the join line(s) with:

my $val = eval{ $join->join() } or die "Join failed with '$!' : '$^E'" +;

And then report back the error texts.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

RIP Neil Armstrong

.


Comment on Re: PANIC: underlying join failed threded tcp server
Download Code
Re^2: PANIC: underlying join failed threded tcp server
by rmahin (Beadle) on Oct 17, 2012 at 22:22 UTC
    Will do. It's hard to recreate though so no guarantee when I'll be able to get this back to you. The same script has been running on 5 different machines (2 windows, 3 unix) for the past week and only one has had this error.
      It's hard to recreate though so no guarantee when I'll be able to get this back to you.

      Understood. If it never happens again, nothing much to do; but if it does, it should yield a little more information that might help identify the cause.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      RIP Neil Armstrong

Re^2: PANIC: underlying join failed threded tcp server
by rmahin (Beadle) on Oct 17, 2012 at 22:32 UTC
    Nevermind. Stressed it a bit more than normal, and got this message:
    Join failed with 'Bad file descriptor' : 'The handle is invalid' at rx +d.pl line 1128. The RXD server has been shutdown.Perl exited with active threads: 1 running and unjoined 79 finished and unjoined 0 running and detached
      'The handle is invalid' at rxd.pl line

      The handle in question would have to be the thread handle itself; which suggests that it has some how become invalid between beong returned from threads->list(threads::joinable) and your calling join(). Which -- provided there are no other detach() than the one shown commented out -- should not be possible!

      As a discovery measure, you could try calling the handle method pprint $join->_handle(); prior to doing the join and see what that yields?

      The only other diagnostic measures I can think of, would entail adding some trace into the threads.xs module. If you're up for that, you could try adding:

      printf( "thread handle:%x thread-id: %dx\n", thread->handle, GetThread +Id( thread->handle ) );

      just before the if(WaitForSingleObject()) call. It might add some info.

      You should also add a call to GetLastError() and print out that and teh failing return code within the body of the if, prior to the PANIC.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      RIP Neil Armstrong

        Based on BrowserUK's post, this sounds like a race condition.

        Alright adding that print message now.

        As for adding the trace messages to threads.xs, not sure how to go about that. I searched for it in the perl installation folder for it but it was not there. Is it part of the threads.dll?

        Do you think any harm would be caused from doing something like my $val = eval{$join->join()}; as just a way to prevent the server from crashing. We have multiple users issuing commands to another larger server, which randomly picks these smaller servers to issue commands against, so one of them going down is very annoying for them and requires us to constantly monitor them.

        Thanks very much for your response again, you are quite the helpful monk.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://999610]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2014-07-10 05:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (199 votes), past polls