Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-34753

memory pressure - erroneous termination condition

    XMLWordPrintable

Details

    Description

      Thanks knielsen:

      I happened upon this patch of yours:

      MDEV-24670 memory pressure - eventfd rather than pipe

      @@ -896,7 +894,7 @@ void mem_pressure::pressure_routine(mem_pressure *m)
         }
       
         ulonglong last= microsecond_interval_timer() - max_interval_us;
      -  while (1)
      +  while (!m->m_abort)
         {
           if (poll(&m->m_fds[0], m->m_num_fds, -1) < 0)
           {
      @@ -909,6 +907,9 @@ void mem_pressure::pressure_routine(mem_pressure *m)
               break;
             }
           }
      +    if (!m->m_abort)
      +      break;
      +
      

      Is it just me, or isn't that if (!m->m_abort) condition inverted? This seems to mean that the thread will never do anything, it will exit immediately the first time it gets any activity on the fd out of poll()?

      Attachments

        Issue Links

          Activity

            People

              danblack Daniel Black
              danblack Daniel Black
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.