-
Notifications
You must be signed in to change notification settings - Fork 1
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
fix: Race condition between iterator and generators #55
Conversation
9d6098e
to
9b39b64
Compare
@@ -107,7 +107,7 @@ describe('Generator Class', () => { | |||
await pipelineParallelGenerators.run() | |||
const file = fs.readFileSync(filePath, {encoding: 'utf-8'}) | |||
const fileLines = file.split('\n').sort() | |||
expect(fileLines.length).to.equal(873) | |||
expect(fileLines.length).to.equal(741) |
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.
This is lower because of the duplicate triples that were being generated.
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 can't seem to find where the duplicate triples issue is solved. Apparently you did (great!) but can you link me to the line(s)? I just want to make sure we do not introduce a OoM issue.
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.
Thanks David! Great that you where able to solve this!
🎉 This PR is included in version 1.0.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
} | ||
|
||
private get batchSize(): number { | ||
return this.stage.configuration.generator[this.index].batchSize ?? DEFAULT_BATCH_SIZE | ||
} | ||
|
||
|
||
public run($this?: NamedNode, batchSize?: number): void { | ||
if ($this !== undefined) this.$thisList.push($this) |
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.
Here the URIs are added to the same this.$thisList
property again, causing duplicates.over.
(influenced by the
delay
andbatchSize
config params) by ending theStage iff both Iterator and all Generators are ended.
and remove it from Generator.
Fix #45
Fix #53