ClientAbortException,Connection reset by peer: socket write error (摘自javaeye)
Posted on 2007-08-10 14:50 leekiang 閱讀(12366) 評(píng)論(5) 編輯 收藏 所屬分類: 應(yīng)用服務(wù)器ClientAbortException? Caused by: java.net.SocketException: Connection reset by peer: socket write error
查了下TOMCAT的文檔,解釋如下:
Wrap an IOException identifying it as being caused by an abort of a request by a remote client.
在BAIDU和GOOGLE上找了下原因,大概歸結(jié)為:
ClientAbortException: java.net.SocketException: Connection reset by peer: socket write error的原因是由于處理http連接時(shí),正在輸出內(nèi)容時(shí),用戶關(guān)閉了IE,會(huì)出現(xiàn)一個(gè)"ClientAbortException",屬于I/O處理中出現(xiàn)的一個(gè)異常,應(yīng)用服務(wù)器應(yīng)該會(huì)捕捉。
Connection reset by peer的原因:
經(jīng)常出現(xiàn)的Connection reset by peer: 原因可能是多方面的,不過(guò)更常見(jiàn)的原因是:
①:服務(wù)器的并發(fā)連接數(shù)超過(guò)了其承載量,服務(wù)器會(huì)將其中一些連接Down掉;
②:客戶關(guān)掉了瀏覽器,而服務(wù)器還在給客戶端發(fā)送數(shù)據(jù);
③:瀏覽器端按了Stop
很多人都說(shuō)是客戶端造成的,沒(méi)有辦法控制,是個(gè)比較郁悶的問(wèn)題。
但是,我擔(dān)心的是:雖然前臺(tái)沒(méi)有任何出錯(cuò)的跡象,但是后臺(tái)會(huì)記錄這個(gè)異常,日志也會(huì)瘋狂爆滿,時(shí)間長(zhǎng)了,肯定會(huì)DOWN掉的,還沒(méi)找到好的解決辦法
resin有一個(gè)參數(shù)ignore-client-disconnect
tomcat似乎沒(méi)有
經(jīng)常出現(xiàn)的Connection reset by peer: 原因可能是多方面的,不過(guò)更常見(jiàn)的原因是:①:服務(wù)器的并發(fā)連接數(shù)超過(guò)了其承載量,服務(wù)器會(huì)將其中一些連接Down掉;②:客戶關(guān)掉了瀏覽器,而服務(wù)器還 在給客戶端發(fā)送數(shù)據(jù);③:瀏覽器端按了Stop
[10054] Connection reset by peer
Connection reset by peer is a
tough one because it can be caused by so many things. In all cases, the
server determines that the socket is no longer good and closes it from
its side.
Read Error
Scenario: Mary couldn't make out what Joe
was saying anymore, so she hung up rather than lose his messages
(data).
A read error occurs when a server cannot successfully read
from a user's client. Servers gather information from the client by
text, setup, and other items.When the server receives an error when
reading from a client, it then disconnects the user, resulting in a read
error quit message.
Write Error
Scenario: Mary was trying to
talk to Joe but didn't think she was getting through, so she hung
rather than lose his messages (data).
A write error occurs when a
server cannot successfully write to a user's client. When the server
receives information, it usually responds with information of its own.
When the server receives an error when writing to a client, it then
disconnects the user, resulting in a write error quit message similar to
the read error format.
Ping Timeout Error
Scenario: Mary,
having been raised in a household with too many kids and always craving
attention, keeps asking to make sure that Joe is still on the line and
listening. If he doesn't reply fast enough to suit her, she hangs up.
Servers automatically ping users at a preset time. The reason for this
is to ensure the client is still connected to the server. When you see
"PING? PONG!" results in your status window, it means the server has
pinged your client, and it has responded back with a pong to ensure the
server that you are still connected. When this does not happen and you
disconnect without the server's knowledge, the server will automatically
disconnect the user when it does not receive a response, resulting in a
ping timeout. Ping timeouts occur to EVERYONE.
Broken pipe Error
Scenario: Mary had picked up a sticky note with a message she needed to
relay to Joe, but somehow between her hand and her mouth, the message
got misplaced. Mary was trying to talk to Joe but didn't think she was
getting through, so she hung up rather than lose his messages (data).
A broken pipe error occurs when the server knows it has a message but
can't seem to use its internal data link to get the data out to the
socket.
Miscellaneous
Scenario: Lots of other reasons;
perhaps the operator broke in and gave Mary a message that made her
doubt the validity of the call so she hung up