Hi Monks,

I am making db connection to sql server using dbi proxy.I have one window service(build using perlsvc) written in perl bundled dbiproxy.exe and myserver.exe.

myserver.exe return a available port when client make INET connection.
my $sock = new IO::Socket::INET( PeerAddr => $server, PeerPort => 9000, Proto => 'tcp', );
myserver.exe checks port used and return a port. after that db connection is made from DBI.
my $dsn = "DBI:Proxy:hostname=$server;port=$port;dsn=DBI:ODBC:" . $sel +f->get_db_name(); $dbh = DBI->connect( $dsn, $self->get_db_user(), $self->get_db_password(), { RaiseError => 1, PrintError => 0 } );
After all db operation we close $dbh handle. Here it should kill dbiproxy.exe running on server. But in some case or may be when too much or parallel connection is made, some zombie process created even after closing DBI connection. This cause on server side that dbiproxy.exe hold a port that should be free.
when reserved port (9000-9100) hold by these process. It failed to get a port.
How I can kill these zombie process. I have tried wmic and tasklist command to get the process status but no luck from it.
Guide me and if need more info let me know.

updates

I did some investigation and found out dbiproxy.exe created folders inside windows directory. like
C:\WINDOWS\TEMP\pdk-SYSTEM-$PID\dbiproxy.exe

I did wmic query to check the list of zombie process and deleted process and after that folder related to these process too.


It seems like now not every process is getting finished as a zombie.


In reply to DBI connection creates zombie process by prashantktyagi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.