1

We have Windows 2k3 EE SP2 with Oracle 11.2.0.1.0 DB installed. The DB is used by different applications (including web-apps and services). From time to time, we have some problems with the web application that causes unexpected behavior in it, e.g. slow or not fully loaded pages, strange redirects. Restarting the Tomcat and Oracle services fixes the issue.

Once when the problem showed up again, I looked at the tomcat logs and noticed an exception:

java.sql.SQLException: Io exception: The Network Adapter could not establish the connection 

It occurred to me that the database server may be busy, overloaded or something, so I examined network activity (with CurrPorts). There were dozens of connections hanging with status of "Last Ack" that originated from the Oracle TNSLSNR.exe process, requesting for local port 1521 (which, as we know, is the port that the process itself "Listens" to).

The CurrPorts software has the option "Close selected TCP connections" when right-clicking, so I used it for all these dead connections. It immediately fixed the connection issues that the web-app experienced. The worst thing is, this situation recurs, as one or two times an hour a new connection stuck at Last ack appears.

All this means that every couple of days, I have to close these connections manually, as I have neither idea why they happen, nor a solution for now.

So, I am wondering what may the cause be for this?

(Image of the Problem)

1 Answer 1

1

Here's a picture of the TCP state diagram:

A system ends up in LAST_ACK when it receives a FIN and becomes the "passive" closer.

The system's IP stack then responds to that FIN with an ACK and sets the related socket to CLOSE_WAIT.

The application then needs to realise the socket is finished, call close() on the socket, then the system's IP stack sends a FIN and sets the socket to LAST_ACK.

The remote end then needs to respond with an ACK and the socket becomes CLOSED. This is the step which isn't happening.

I see you're using the local system's IP address as both source and destination. I'm sorry I don't know more about local host communication on Windows. This might be a Windows problem or an Oracle problem. I hope that at least helps you understand what is happening, if not why.

2
  • I think I understood. I noticed some (maybe related) CLOSE_WAIT connections and I am wondering if both sockets of the communication could be performing "Passive" close and if this may be the reason for the problem. I will have to thoroughly search my code for wrong socket close procedures. Thanks for the info! Commented Jan 29, 2014 at 16:12
  • No, one side is always the active closer, one side is always the passive closer. The active closer is the one who sends the first FIN. Presumably, the active closer is the end whose application closed its socket first. Commented Mar 9, 2014 at 8:09

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.