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 C
    • Sprint 80 (Sep 2021), Sprint 81 (Oct 2021), Sprint 82 (Nov 2021), Sprint 83 (Dec 2021), Sprint 84 (Jan 2022), Sprint 85 (Feb 2022), Sprint 86 (Mar 2022), Sprint 87 (Apr 2022), Sprint 88 (May 2022), Sprint 89 (Jun 2022), Sprint 90 (Jul 2022), Sprint 91 (Aug 2022), Sprint 92 (Sep 2022)
    • 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

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated: