Details

    Description

      Change the following to statistic counters:
       
      my_file_opened
      my_file_total_opened
      my_stream_opened
      my_tmp_file_created
      There is one non-statistics use of my_file_opened/my_stream_opened
      in my_end which prints a warning if we shutdown and its still open.
      It seems excessive to hold locks to prevent this warning.
       
      A file descriptor is already a unique element - in Windows protection
      occurs at fd allocation using THR_LOCK_open in my_win_fopen
      and in other OSes, a unique fd to file map exists at the OS level.
      So accesses to my_file_info[fd] don't need to be protected by the
      THR_LOCK_open.
       
      my_close/my_fclose where restructured to clear out the my_file_info
      before the close/my_win_close. After these calls another thread could
      gain the same file descriptor. Windows doesn't need THD_LOCK_open
      into my_win_close as there is no conflict with the my_win_fopen in allocating a fd.
       
      my_fclose also changed for non-Windows to retry closing if EINTR was
      returned, same as my_close..
       
      FYI @vaintroub
       
      Pathological cases - two threads attempt to close the same file at same time at which there is a chance of double free. If there is this case, there's a equal failing that the file descriptor could have been reallocated before the second close call was complete, also leading to wrongness.
      

      Attachments

        Activity

          svoj Sergey Vojtovich created issue -
          serg Sergei Golubchik made changes -
          Field Original Value New Value
          Status Open [ 1 ] Confirmed [ 10101 ]
          serg Sergei Golubchik made changes -
          Status Confirmed [ 10101 ] In Review [ 10002 ]
          serg Sergei Golubchik made changes -
          Status In Review [ 10002 ] Stalled [ 10000 ]
          serg Sergei Golubchik made changes -
          Fix Version/s 10.3.7 [ 23005 ]
          Fix Version/s 10.3 [ 22126 ]
          Resolution Fixed [ 1 ]
          Status Stalled [ 10000 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 86158 ] MariaDB v4 [ 133501 ]

          People

            serg Sergei Golubchik
            svoj Sergey Vojtovich
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.