hiero-ledger / hiero-ledger/hiero-consensus-node

Non-static ThreadLocals

Open
#5,185 4 comments 0 reactions 1 assignee Claimed by @OlegMazurov View on GitHub
Bug Platform
Dominant language
Java
Stars
406
Forks
226
Avg merge
3d 4h
Merged PRs (30d)
210

Description

`DataFileReader.ThreadLocalSeekableByteChannel` extends `ThreadLocal`. A non-static `seekableByteChannel` of that type is instantiated for each `DataFileReader`, thus a new `ThreadLocal` is repeatedly created ("key", not value). `ThreadLocals` should be static.

In other places:
* CachingOperationProvider.context
* VirtualLeafRecordSerializer.dataOutputStream
* BucketSerializer.reusableBuckets
* VirtualHasher.hashBuilderLocal

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.