Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-19826

Concurrency bug in Zabbix, first to finish kills other standalone clients session.

    XMLWordPrintable

Details

    • Team A
    • Sprint 80 (Sep 2021), Sprint 81 (Oct 2021), Sprint 82 (Nov 2021)
    • 0.5

    Description

      Steps to reproduce:

      1. Run 4 or more concurrent Zabbix clients (same user id/ password) from different forked processes
      2. When one of them finishes before the other, session is invalidated on server side and causes an exception on the other clients

      To get a new session:

       def get_zabbix_api(self):
      """
      Get a Zabbix session
      :return: ZabbixAPI instance
      """
      return ZabbixAPI(url=self.url, user=self.user, password=self.password) 

      To close the session:

      if zapi is not None:
      zapi.user.logout() 

       

      Result:

      pyzabbix.api.ZabbixAPIException: {'code': -32500, 'message': 'Application error.', 'data': 'SQL statement execution has failed "DELETE FROM sessions WHERE status=\'1\' AND userid=\'71\'"', 'json': "{'jsonrpc': '2.0', 'method': 'user.logout', 'params': {}, 'id': '1', 'auth': '********'}"} 

      Expected:
      Each session should stay alive regardless if other sessions are active. To be clear, this is not a multi threaded application but 4 or more different scripts running different get_history methods.

      Attachments

        1. deadlock1.txt
          6 kB
        2. deadlock2.txt
          9 kB
        3. query-failures.txt
          1 kB

        Activity

          People

            jfreibergs Janis Freibergs
            jnunez@striketechnologies.com Jose Vicente Nunez
            Votes:
            1 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated: