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
[bindings/go] Remove finalizers in favor of copying and destroying the native resources immediately #1910
Conversation
…rces immediately. Except for futureKeyValueArray, all futures which allocate native heap resources (other than the futures themselves) will allocate Go resources and copy from native to Go, then destroy the native heap resources.
@fdb-build, ok to test |
@alexmiller-apple is there a reason I can’t view the CI logs? |
@ryanworl, according to @AlvinMooreSr, we started getting throttled by bintray on uploading them, and the jury is out on when they'll unthrottle us. So it's a known our-side problem for now. Documentation:
CMake MacOS:
and MacOS is a known issue on all PRs right now. |
@fdb-build, test macos please |
That one is a real error from my bringing my changes from 610 to 620. |
@@ -366,27 +407,40 @@ type FutureStringSlice interface { | |||
|
|||
type futureStringSlice struct { | |||
*future | |||
o sync.Once | |||
e error | |||
v []string |
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 would suggest using once
instead of o
(once.Do
reads much better) and err
instead of e
in field names (I see err
used at other parts of this file). I dunno what v
is, which probably is good indicator that it should be renamed too.
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.
In that case, it is the value the future will resolve with.
I agree with your assessment about the names, but I don’t know if this PR is the place to resolve it.
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.
Ah ok. I missed that it was that way already in other part of codebase.
@ryanworl, we're going to be cutting the 7.0 release sometime over the next few weeks. If you're still interested in working on this, and would like it to get into the 7.0 release, then it'd be good to work towards getting it merged within a couple weeks. |
@fdb-build, test cmake please |
@fdb-build test ctest please |
@fdb-build, test cmake macos please |
@fdb-build, test ctest please |
Revert "Merge pull request #1910 from ryanworl/ryanworl/remove-finali…
Fixes #1340
Except for
futureKeyValueArray
, all futures which allocate native heap resources (other than the futures themselves) now allocate Go resources and copy from native to Go, then destroy the native heap resources.This adds an explicit
Close()
function toRangeIterator
which users should call.I also added an optimization for
futureKeyValueArray
which allocates one large[]byte
for the result of each batch and subdivides within that instead of allocating individual[]byte
for each key and value.I haven't evaluated this much yet, so I'd like to do that before merging. I'll comment once I have.
Not ready yet.