Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-4986

Make HepProgram thread-safe

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.30.0
    • None

    Description

      HepProgram uses mutable fields for its working state and is therefore not thread-safe. If two threads are planning queries simultaneously and are using the same HepProgram instances they might conflict with each other. I suspect that this happens several times in Calcite's standard set of rules.

      This change would move the mutable state out of HepProgram, so that HepProgram is fully immutable and therefore thread-safe.

      It would also modernize some of the internals; for instance, class HepInstruction.MatchLimit has a field int limit that could be made final and assigned in the constructor.

      Attachments

        Issue Links

          Activity

            People

              julianhyde Julian Hyde
              julianhyde Julian Hyde
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m