私のアプリケーションでは、ページの読み込み時に Jquery を使用して Ajax get リクエストを開始します。呼び出しに異常に長い時間がかかる場合、ユーザーは標準のブラウジング セッション中に最初のページから移動する可能性があります。最終的に、この ajax 呼び出しが完了し、応答が返されます。問題は、この時点でユーザーがページを離れており、応答をリッスンしていないことです。それが発生すると、ログにこの例外が記録されます。
----------------------------------------
Exception happened during processing of request from ('98.x.x.x', 36495)
Traceback (most recent call last):
File "M:\Python2.7\App\lib\SocketServer.py", line 582, in process_request_thread
self.finish_request(request, client_address)
File "M:\Python2.7\App\lib\SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "M:\Python2.7\App\lib\site-packages\django\core\servers\basehttp.py", line 139, in __init__
super(WSGIRequestHandler, self).__init__(*args, **kwargs)
File "M:\Python2.7\App\lib\SocketServer.py", line 640, in __init__
self.finish()
File "M:\Python2.7\App\lib\SocketServer.py", line 693, in finish
self.wfile.flush()
File "M:\Python2.7\App\lib\socket.py", line 303, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 10053] An established connection was aborted by the software in your host machine
----------------------------------------
どうすればこれを防ぐことができますか?
例外にリストされているファイルはどれも私のコードではありません。