You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2022/01/19 06:24:00 UTC

[jira] [Resolved] (CALCITE-4986) Make HepProgram thread-safe

     [ https://issues.apache.org/jira/browse/CALCITE-4986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julian Hyde resolved CALCITE-4986.
----------------------------------
    Resolution: Fixed

Fixed in [0065d7c1|https://github.com/apache/calcite/commit/0065d7c179b98698f018f83b0af0845a6698fc54].

> Make HepProgram thread-safe
> ---------------------------
>
>                 Key: CALCITE-4986
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4986
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Assignee: Julian Hyde
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.30.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> {{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. 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)