Skip to content

[C++] DictionaryArray::dictionary() is not thread safe #36503

@bkietz

Description

@bkietz

Describe the bug, including details regarding any error messages, version, and platform.

DictionaryArray::dictionary() lazily initalizes an Array to wrap its ArrayData::dictionary, but does not explicitly synchronize this so another thread which happens to call the same array's dictionary() function would introduce a data race.

StructArray::field() does similar lazy initialization but does synchronize, so it should be usable as a reference for fixing this.

See also discussion here: https://github.com/apache/arrow/pull/36418/files/e7196196b7262bb3988ac35347a94e7b41c22ce8#r1248319000

Component(s)

C++

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions