Hello,
How would one handle the following?
We have added the initation of the class and establish connection at config time in
__init__.py
This definatelly works, but now we are getting into issues where we get connection reset by peer. I guess in the other scenerio we connected every time, so every time we established a new connection. Now we are re-using the connection which causes below:
How can I try/except this at the __init__.py level in the config,...or what do I do in views.py to except and redo "
config.registry.MY = MYContract()" to fix the connection issue.
[Thu Nov 01 09:50:28.215262 2018] [wsgi:error] [pid 26861:tid 140425465390848] [remote a]
[Thu Nov 01 09:50:28.215271 2018] [wsgi:error] [pid 26861:tid 140425465390848] [remote a] Traceback (most recent call last):
[Thu Nov 01 09:50:28.215277 2018] [wsgi:error] [pid 26861:tid 140425465390848] [remote a] File "zzzzzzzzzzz/raven/utils/serializer/manager.py", line 76, in transform
[Thu Nov 01 09:50:28.215283 2018] [wsgi:error] [pid 26861:tid 140425465390848] [remote a] return repr(value)
[Thu Nov 01 09:50:28.215295 2018] [wsgi:error] [pid 26861:tid 140425465390848] [remote a] TypeError: __repr__ returned non-string (type bytes)
[Thu Nov 01 09:50:28.215326 2018] [wsgi:error] [pid 26861:tid 140425465390848] [remote a]
[Thu Nov 01 09:50:28.244058 2018] [wsgi:error] [pid 26861:tid 140425465390848] [remote a] mod_wsgi (pid=26861): Exception occurred processing WSGI script '/zzzzzzzzzzzzz.wsgi'.
..........l, headers=headers)
[Thu Nov 01 09:50:28.247647 2018] [wsgi:error] [pid 26861:tid 140425465390848] [remote a] File "zzzzzzzzzzzz/python3.5/site-packages/httplib2/__init__.py", line 1322, in request
[Thu Nov 01 09:50:28.247653 2018] [wsgi:error] [pid 26861:tid 140425465390848] [remote a] (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
[Thu Nov 01 09:50:28.247663 2018] [wsgi:error] [pid 26861:tid 140425465390848] [remote a] File "/zzzzzzzzz/python3.5/site-packages/httplib2/__init__.py", line 1072, in _request
[Thu Nov 01 09:50:28.247669 2018] [wsgi:error] [pid 26861:tid 140425465390848] [remote a] (response, content) = self._conn_request(conn, request_uri, method, body, headers)
[Thu Nov 01 09:50:28.247752 2018] [wsgi:error] [pid 26861:tid 140425465390848] [remote a] self.send(msg)
[Thu Nov 01 09:50:28.247761 2018] [wsgi:error] [pid 26861:tid 140425465390848] [remote a] File "/usr/lib/python3.5/http/client.py", line 908, in send
[Thu Nov 01 09:50:28.247768 2018] [wsgi:error] [pid 26861:tid 140425465390848] [remote a] self.sock.sendall(data)
[Thu Nov 01 09:50:28.247792 2018] [wsgi:error] [pid 26861:tid 140425465390848] [remote a] ConnectionResetError: [Errno 104] Connection reset by peer
Thank you
Lucas