Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: utl_smtp Hanging when opening a connection
joel garry wrote:
> On Nov 29, 1:24 pm, Ian M <noemailheretha..._at_news.com> wrote:
>> collins.pa..._at_googlemail.com wrote: >>> We are using utl_smtp to send emails from our database. We currently >>> run Oracle 9.2 on RHEL4, with Postfix as our mailserver.
>>> Lately, we have noticed that the process creating the email is >>> hanging, which often requires the database to be taken down to fully >>> kill off the session. (This is on our test system, fortunately).
>>> Having looked at a numnber of posts on various forums, I have seen >>> that this is not an uncommon problem. Oracle have included a timeout >>> parameter in utl_smtp.open_connection, but this is not implemented for >>> write processes (in version 9.1 to 10.2, although more may be the >>> same), and from comments, I have seen that this timeout functionality >>> does not apply to opening the connection itself. >>> Has anybody come up with a solution to programmatically cause the open >>> connection to timeout if a connection is not established in a >>> reasonable time, and if so, can you please help me. >>> Many thank in anticipation, >>> Paul >> Hi Paul, >> >> I am not sure about RHEL4 but I had a similar situation a few years back >> on a HP box with frequent external network problems. >> >> To reduce the impact of this I amended the servers TCP settings (I think >> it was tcp_ip_abort_cinterval I'm not 100% though). This caused the >> failed open connection attempts to close much faster which was useful >> for server scanning failures etc. >>
Hi Joel,
I found your comment on 11i interesting and frankly surprising as I was not aware of a change here, I decided to test it, the results may surprise you.
# uname -a
HP-UX XXXXXXXX B.11.11 U 9000/800.....
I checked what the current value setting was
# /usr/bin/ndd -get /dev/tcp tcp_ip_abort_cinterval
75000
The IP 123.123.123.123 is blocked by a firewall so similar to any network down problems.
S=$SECONDS;telnet 123.123.123.123 1521;echo "$(($SECONDS-$S)) Seconds."
...
75 Seconds.
So we are looking at a SYN_SENT for the 75 seconds before connection abort.
I then set this value to 10 seconds.
# /usr/bin/ndd -set /dev/tcp tcp_ip_abort_cinterval 10000
S=$SECONDS;telnet 123.123.123.123 1521;echo "$(($SECONDS-$S)) Seconds."
...
10 Seconds.
Obviously I agree completely on the platform and OS specific comment, the moral is indeed check everything.
Regards, Ian. Received on Thu Nov 29 2007 - 18:29:31 CST
![]() |
![]() |