Browse Source

AMBARI-24638. Ambari-agent process consuming more memory. (aonishuk)

Andrew Onishuk 7 years ago
parent
commit
4db8904e67
1 changed files with 2 additions and 1 deletions
  1. 2 1
      ambari-common/src/main/python/ambari_ws4py/websocket.py

+ 2 - 1
ambari-common/src/main/python/ambari_ws4py/websocket.py

@@ -480,7 +480,8 @@ class WebSocket(object):
         if not bytes and self.reading_buffer_size > 0:
         if not bytes and self.reading_buffer_size > 0:
             return False
             return False
 
 
-        self.reading_buffer_size = s.parser.send(bytes) or DEFAULT_READING_SIZE
+        with self.lock:
+          self.reading_buffer_size = s.parser.send(bytes) or DEFAULT_READING_SIZE
 
 
         if s.closing is not None:
         if s.closing is not None:
             logger.info("Closing message received (%d) '%s'" % (s.closing.code, s.closing.reason))
             logger.info("Closing message received (%d) '%s'" % (s.closing.code, s.closing.reason))