You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2016/05/26 19:20:12 UTC

[jira] [Commented] (ASTERIXDB-1220) Race condition in AObjectPrinter singleton instance

    [ https://issues.apache.org/jira/browse/ASTERIXDB-1220?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15302731#comment-15302731 ] 

ASF subversion and git services commented on ASTERIXDB-1220:
------------------------------------------------------------

Commit fd7fb5a1002a8ad787d50610893e1bf0e6421ac7 in incubator-asterixdb's branch refs/heads/master from [~tillw]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-asterixdb.git;h=fd7fb5a ]

ASTERIXDB-1220: print nested values using visitors

- remove named printer classes
- remove redundancy between AObjectPrinterFactory and PrintVisitor
- remove redundant List- and RecordPrinters
- introduce AbstractPrintVisitor

Change-Id: I692c04dd1b3aa8e7adccfe960615f0fc2df6fe26
Reviewed-on: https://asterix-gerrit.ics.uci.edu/882
Reviewed-by: Yingyi Bu <bu...@gmail.com>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>


> Race condition in AObjectPrinter singleton instance
> ---------------------------------------------------
>
>                 Key: ASTERIXDB-1220
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-1220
>             Project: Apache AsterixDB
>          Issue Type: Bug
>          Components: AsterixDB, Data Formats
>            Reporter: Wail Alkowaileet
>            Assignee: Till Westmann
>
> Hi,
> The bug appears clearly when two queries race to print their output using AObjectPrinter singleton in the same DataFormat.
> {noformat}
>             public void print(byte[] b, int start, int l, PrintStream ps) throws AlgebricksException {
>                 try {
>                     listAccessor.set(b, start, l);
>                     arg.first = ps;
>                     listAccessor.accept(printVisitor, arg);
>                 } catch (Exception ioe) {
>                     throw new AlgebricksException(ioe);
>                 }
>             }
> {noformat}
> Since there's only one instance of AObjectPrinter, this will be a critical section and things will lose track (such as ps and listAccessor).
> I think new printer should be instantiated for each query.
> To produce the problem:
> Running the query in two clients:
> {noformat}
> //As in runtimets/queries/open-closed/query-issue55.3.query.aql
> for $x in [[1,3],[4,5,2],[-1,-3,0],["a"]]
> return $x
> {noformat}
> interchange the execution sequence in the two threads such as:
> Thread 1 run: listAccessor.set(b, start, l);
> Thread 2 run: listAccessor.set(b, start, l);
> Thread 1 resume running.
> Thread 2 resume running.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)