Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-9602

Transaction timeout setter could break GridTimeoutProcessor behavior

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.7
    • None
    • cache
    • None

    Description

      Current transaction API provides setter method for transaction timeout. It is possible to run transaction as follows:

      try (Transaction tx = ign.transactions().txStart()) {
          tx.timeout(TimeUnit.MINUTES.toMillis(10));
          ...
      }
      

      If default timeout is configured to smaller timeout value then it is possible that transaction will be added to the head of timeout queue. Changing timeout after that to some big number will lead to situation when head of timeout queue contains not smallest timeout end time value, totally breaking invariant of that queue. It could lead to a different negative consequences. From delaying other tasks in timeout processor until mentioned transaction completes or timeouts to completely stalling timeout processor progress (broken queue invariant could lead to impossibility to remove objects from it). (java.util.concurrent.ConcurrentSkipListMap is used under the hood of the timeout queue)
      Actually GridNearTxLocal.timeout setter tries to reset timeout but does it improperly. It looks like that behavior was broken not long ago.
      Reproducer is attached.

      Attachments

        1. TimeoutBugReproducer.java
          4 kB
          Ivan Pavlukhin

        Activity

          People

            ascherbakov Alexey Scherbakov
            Pavlukhin Ivan Pavlukhin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: