onflow / atree

Atree provides scalable arrays and scalable ordered maps.
https://onflow.org
Apache License 2.0
39 stars 16 forks source link

Fix error handling in FastCommit() #241

Closed fxamacker closed 2 years ago

fxamacker commented 2 years ago

Description

Prevent error handling in FastCommit() from closing channel before all goroutines are done.

This PR resolves nondeterministic CI test failure from slower goroutine sending on closed channel after FastCommit() exits early on error detection.

Test case to reproduce the problem uses division in a loop to simulate slow encoding inside a goroutine because using sleep was flaky.

Closes #240