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

DO SLEEP() incorrect evaluation when running procedure for long time

Details

    Description

      When running long stored procedures with lots of DO SLEEP() (with variable argument), randomly the evaluation of the argument produces incorrect results, effectively returning from the SLEEP function much beforehand the intented time.

      Attachments

        1. test_2.sql
          125 kB
        2. test.sql
          701 kB

        Activity

          alice Alice Sherepa added a comment -

          Could you please add the test case to demonstrate the problem?

          alice Alice Sherepa added a comment - Could you please add the test case to demonstrate the problem?

          Hello Alice,
          I attached two SQL files to this bug.
          The files represents two databases that I use in my system.
          You can import both of them in your MariaDB server to test.
          One database will be called "solaris_1_control" and the other "solaris_server"
          In "solaris_1_control" there is a stored procedure called "logic_procedure_1",
          it is very complex but basically do some sleeps and some updates on "solaris_1_control".
          After some hours of running (not always) the SLEEP functions inside the procedure starts to return
          much beforehand, approximately the wait time lasts 5 seconds (instead of some hours...).

          Please let me know, I think that maybe this can be a bug with the interpretation of the argument or
          with threads interruption...scratching my head

          emiliojazz Emiliano Paterlini added a comment - Hello Alice, I attached two SQL files to this bug. The files represents two databases that I use in my system. You can import both of them in your MariaDB server to test. One database will be called "solaris_1_control" and the other "solaris_server" In "solaris_1_control" there is a stored procedure called "logic_procedure_1", it is very complex but basically do some sleeps and some updates on "solaris_1_control". After some hours of running (not always) the SLEEP functions inside the procedure starts to return much beforehand, approximately the wait time lasts 5 seconds (instead of some hours...). Please let me know, I think that maybe this can be a bug with the interpretation of the argument or with threads interruption... scratching my head

          People

            Unassigned Unassigned
            emiliojazz Emiliano Paterlini
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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