good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re^3: Problem enumerating a foreach loop using Win32::OLE->GetObjectby Discipulus (Canon) |
on Apr 12, 2018 at 19:42 UTC ( [id://1212754]=note: print w/replies, xml ) | Need Help?? |
Hello again, you must try to isolate your problem. I admit that, for me, reading the expose of your question result to be a bit difficult. Also the code you show is not so perlish and lacks of use strict; use warnings; Anyway, wat I found is: > Only certain machines are causing the hang/lock. You have not to eval/jail (as you say) the function: you are outside perl domain. Infact you are dealing with something similar to a complex system call: microsoft stuff are well known to return (or not return) weird behaviours. You know if you are used to work with these things. If a remote call fails or hangs is not useful to wrap in eval and wait 300 seconds to have back a 255 error or something else, equally unuseful. Better try to whatch $^E that is last operating system error or even better check first if the machine is reachable. Programatically or manually check the Event Viewer in the remote machine to spot some (rare) useful entries. Other sparse hints: the problem maight be at RPC level (i'm in guess mode now..) try some command line version using wmic to confirm both versions hangs; wmi connection can be set to use a timeout, like in $os.options.Timeout=[timespan]::FromSeconds(30) or similar. There are here around WMI Diagnosis Utility and WMIdiag. Build a list of hanging machines and look at them carefully (what if remote service is stopped? ram cpu?)
L*
There are no rules, there are no thumbs.. Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
In Section
Seekers of Perl Wisdom
|
|