Ticket #3662 (closed defect: fixed)

Opened 11 months ago

Last modified 29 hours ago

Gajim fails to send keepalives with high CPU usage

Reported by: danguy Owned by: asterix
Priority: normal Milestone: 0.12
Component: xmpppy Version:
Severity: normal Keywords:
Cc: OS: All

Description

I am experiencing random disconnects with an Openfire server that has an idle timeout of 6 minutes. Gajim is set to send keepalives every 55 seconds (ie. default, it actually sends them every 56 seconds apparently).

One cause I have identified is that high CPU usage prevents the keepalives from being sent on time.

Here is a log while running a compile job with a nice of 1:

1199657219.65: Connected to <server>, storing initial clock offset
+       73.32: Sending keepalive to <server>
+      100.21: Sending keepalive to <server>
+       56.07: Sending keepalive to <server>
+       76.23: Sending keepalive to <server>
+       68.21: Sending keepalive to <server>
+      406.09: Disconnected from <server>
+       11.63: Connected to <server>
+      135.40: Sending keepalive to <server>
+      361.26: Disconnected from <server>

Attachments

Change History

Changed 11 months ago by asterix

Are you sure nothing is sent / receive ? this reset timeout counter to 0.

I think it's strange that a server disconnects on inactivity ... this means you do have to chat to stay connected ??

Changed 11 months ago by danguy

Oh, sorry for the confusion. This log was produced by some print statements added to _connect_success, send_keepalive, and disconnect in connection.py. I postprocessed the timestamps to produce deltas to aid in my understanding of the problem.

The actual code in each case looks like this:

print "%s: Disconnected from %s" % (str(time.time()), self.name)

The server stays connected so long as keepalives or chats are sent. The problem is that under high CPU load, keepalives are not always sent.

Changed 11 months ago by asterix

could you give me your full patch so I can test here? my server doesn't disconnect after some idletime, so I can't really know if keepalives are sent ...

Changed 11 months ago by danguy

--- src/common/connection.py	(revision 9231)
+++ src/common/connection.py	(working copy)
@@ -190,6 +190,7 @@
 	def disconnect(self, on_purpose=False):
 		#FIXME: set the Tune to None before disconnection per account
 		#gajim.interface.roster._music_track_changed(None, None)
+		print "%s: Disconnected from %s" % (str(time.time()), self.name)
 		self.on_purpose = on_purpose
 		self.connected = 0
 		self.time_to_reconnect = None
@@ -574,6 +575,8 @@
 		con.RegisterDisconnectHandler(self._disconnectedReconnCB)
 		log.debug(_('Connected to server %s:%s with %s') % (self._current_host['host'],
 			self._current_host['port'], con_type))
+		
+		print "%s: Connected to %s" % (str(time.time()), self.name)
 
 		name = gajim.config.get_per('accounts', self.name, 'name')
 		hostname = gajim.config.get_per('accounts', self.name, 'hostname')
@@ -1550,6 +1553,7 @@
 	def send_keepalive(self):
 		# nothing received for the last foo seconds (60 secs by default)
 		if self.connection:
+			print "%s: Sending keepalive to %s" % (str(time.time()), self.name)
 			self.connection.send(' ')
 
 	def _reconnect_alarm(self):

Changed 7 weeks ago by alston@…

I seem to be running into the same problem with my OpenFire? server. Gajim is a great IM client and I would like to recommend it to our users, but I won't be able to until this is resolved.

Changed 4 weeks ago by asterix

things have completly changed now. We use XMPP Ping to ping server instead of sending ' '. Do you still have this issue with svn or 0.12-alpha1 version?

Changed 29 hours ago by asterix

  • status changed from new to closed
  • resolution set to fixed
  • milestone set to 0.12

reopen if you still have problem with 0.12 branch

Add/Change #3662 (Gajim fails to send keepalives with high CPU usage)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.