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

Possible file handle leak if vfs.dir.count times out

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Fixed
    • Icon: Trivial Trivial
    • 4.0.4rc1, 4.2.0alpha2, 4.2 (plan)
    • 4.0.2, 4.2.0alpha1, 4.2 (plan)
    • Agent (G)
    • None
    • Sprint 46, Nov 2018, Sprint 47, Dec 2018
    • 2

      This ticket is created due to comment

      Current suspicion is that handle leak happen when thread is killed by timeout while handle is still open. It should be considered to terminate thread differently as per windows documented better solution:

      The TerminateThread and TerminateProcess functions should be used only in extreme circumstances, since they do not allow threads to clean up, do not notify attached DLLs, and do not free the initial stack. In addition, handles to objects owned by the thread are not closed until the process terminates. The following steps provide a better solution:

      Create an event object using the CreateEvent function.
      Create the threads.
      Each thread monitors the event state by calling the WaitForSingleObject function. Use a wait time-out interval of zero.
      Each thread terminates its own execution when the event is set to the signaled state (WaitForSingleObject returns WAIT_OBJECT_0).

            asitals Andrejs Sitals (Inactive)
            vso Vladislavs Sokurenko
            Team A
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: