-
Notifications
You must be signed in to change notification settings - Fork 492
OPENNLP-1816: Make ME classes thread-safe by eliminating shared mutable instance state #1003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
krickert
wants to merge
24
commits into
apache:main
Choose a base branch
from
ai-pipestream:feature/thread-safe-me
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
178386f
OPENNLP-1816: Make ME classes thread-safe by eliminating shared mutab…
krickert cb6e6f4
OPENNLP-1816: Ensure thread safety for all stateful feature generator…
krickert f65b567
OPENNLP-1816: Fix ThreadLocal implementation for ME classes and BeamS…
krickert b80d3a1
OPENNLP-1816: Finalize thread-safety fixes and documentation
krickert 9b9eea9
OPENNLP-1816: Add LemmatizerME null guard, rename cache property, add…
krickert 90123d6
OPENNLP-1816: BeamSearch review follow-up (Javadoc, inheritDoc, cache…
krickert 6673a0a
OPENNLP-1816: Assign bestSequence after null check in ME classes
krickert 794fa23
OPENNLP-1816: Format JMH benchmarks for 110-column style
krickert b193ca1
OPENNLP-1816: Widen ThreadSafetyBenchmarkTest constant line
krickert 7c1772c
OPENNLP-1816: Refactor ConfigurablePOSContextGenerator cache paths
krickert 3a43f71
OPENNLP-1816: CachedFeatureGenerator else branch and deprecated stats
krickert 4334043
OPENNLP-1816: ThreadSafe and field notes on feature generators
krickert 3b722eb
OPENNLP-1816: Reject POSTaggerME contextCacheSize below -1
krickert c1c00ae
OPENNLP-1816: Tighten POSTaggerME constructor formatting
krickert 6de4b0d
OPENNLP-1816: Javadoc for CachedFeatureGeneratorTest methods
krickert 6911a60
OPENNLP-1816: ThreadSafetyBenchmarkTest 110-col sweep and Javadoc
krickert 1c6d933
OPENNLP-1816: Run thread-safety benchmark as Failsafe IT
krickert 13177da
OPENNLP-1816: ME last-result state and Javadoc line length
krickert 7e44232
OPENNLP-1816: Drop strong Thread reference in LastResultOwnerOrThread…
krickert 26ef515
OPENNLP-1816: BeamSearch tempScores reuse and thread-safety Javadoc p…
krickert cb4d7f2
OPENNLP-1816: POSTaggerNameFeatureGenerator per-thread sentence cache
krickert c6274c4
OPENNLP-1816: DictionaryFeatureGenerator safe-publication and @Thread…
krickert 19a2ac6
OPENNLP-1816: NameFinderME drop nested ThreadLocal, share AFG instance
krickert 42f499b
OPENNLP-1816: Update docs for thread-safe ME classes in 3.0.0
krickert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered that shape, but left
threadStateas aThreadLocaleven whencacheSize == 0on purpose: turning off the optional contexts cache is not the same as having no per-thread state —BeamSearchstill needs isolated buffers foreval/ beam work when multiple threads hit the same instance.Dropping to
nullwould just force a different place to stash that state (or reintroduce races). Happy to add a one-line comment next to the field if that helps future readers.