This repository was archived by the owner on May 3, 2023. It is now read-only.
forked from apple/foundationdb
-
Notifications
You must be signed in to change notification settings - Fork 2
bindings/go: safe finalization #1
Open
avaskys
wants to merge
1,568
commits into
master
Choose a base branch
from
av/safe-gc
base: master
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
Conversation
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
atomicReplace currently does not preserve the ownership and permission info, this fix will preserves the ownership and permission info - it fails the call if it is not able to do so.
Fixing the Tutorials Link
…a and Python Technically, they are still treated differently in Java and Python, but now, Java throws an exception if it encounters malformed UTF-16 to avoid serializing things in ways that it cannot deserialize. It also now throws an error when reading malformed UTF-8, which I think is safer as it stops it from accidentally doing something like reading bytes and then writing it back but accidentally writing to the wrong spot, but that might be a mistake.
Co-Authored-By: etschannen <[email protected]>
This is similar one to DataDistributor.
Popping the disk queue now requires potentially recovering the location to which we can pop from the spilled data itself, and for each tag we must maintain the first location with relevant data. The previous queue we had to represent the ordering, queueOrder, was used by spilling, and popped when a TLog had been spilled. This means that as soon as a TLog has been fully spilled, we have no idea how it relates in order to other fully spilled TLogs. Instead, use queueOrder to keep track of all the TLog UIDs until they're removed, and use spillOrder to keep track of the order only for spilling.
This time, track what location in the DiskQueue has been spilled in persistent state, and then feed it back into the disk queue before recovery. This also introduces an ASSERT that recovery only reads exactly the bytes that it needs to have in memory.
Occasionally log a backtrace when the fast allocators allocates a new magazine
…ough, and then pay back what was over the limit in the next update
Spill-By-Reference TLog Part 5: TLogs That Can Spill Large Amounts Of Data
Public address is required for roles FDBD, NetworkTestServer and Restore only. Therefore, check those cases, and for others follow the earlier behaviour of using default ip address 0. FIXES apple#1305
atomicReplace to preserve owner & permission info
configure memory now selects the ssd engine for transaction log spilling
Increased the GRV client batch size
The mr-status-json-schemas.rst.inc file is a manually changed file based on the automatically generated commented document about the JSON status
For 6.1 release, we use the script (will be removed) to generate the comment for JSON status docuemnt; We manually change the docuemnt to document the 7 occurances of the map keyword
Python 2 resolves escape characters when printing byte strings, which doesn't seem useful in this context. I replaced __str__ since it defaults to __repr__ and the change should be suitable for both cases.
Improve Python KeySelector representation
Python 2 resolves escape characters when printing byte strings, which doesn't seem useful in this context. I replaced __str__ since it defaults to __repr__ and the change should be suitable for both cases.
Improve Python KeySelector representation (cherry-picked from master)
…rever and eventually run out of memory.
fix: Parse IPv6 addresses correctly in status details
Co-Authored-By: etschannen <[email protected]>
Co-Authored-By: etschannen <[email protected]>
Co-Authored-By: etschannen <[email protected]>
Co-Authored-By: etschannen <[email protected]>
Updated release notes for 6.1.0
…ch, to avoid multiple actors attempting to modify oldLogSystem at the same time
This fixes crashes from AsyncFileWinASIO refusing to open a file that didn't have OPEN_UNBUFFERED.
Open incrementalDelete files with OPEN_UNBUFFERED
Bug fix, starting a restore on a tag already in-use would hang and eventually OOM
Cancel the previous log system recruitment before calling newEpoch
…we prefer issuing the batch over other possible work
Increase the priority of the client’s version batch timeout
Merge 6.1 into master
When calling a function on a struct with a finalizer, the struct can be destroyed/finalized within the function if it will no longer be reachable. Example: https://play.golang.org/p/Lv19twqhDEU This is fine in the example, but imagine if `data` were instead a cgo pointer that gets freed by the finalizer. We'd end up using the pointer after freeing it and badness would ensue. Instead, we should ensure that the struct stays alive within any functions in which its wrapped pointer is used. We can use `defer runtime.KeepAlive()` to this end. I looked for all structures that have a finalizer set and audited their `.ptr` usage, adding `runtime.KeepAlive()`s as necessary. This is probably a bit overkill, as the struct will stay alive beyond most of those function calls, but IMO it's better to be explicit here.
This was referenced Apr 5, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
When calling a function on a struct with a finalizer, the struct can
be destroyed/finalized within the function if it will no longer be
reachable. Example: https://play.golang.org/p/Lv19twqhDEU
This is fine in the example, but imagine if
datawere insteada cgo pointer that gets freed by the finalizer. We'd end up
using the pointer after freeing it and badness would ensue.
Instead, we should ensure that the struct stays alive within any
functions in which its wrapped pointer is used. We can use
defer runtime.KeepAlive()to this end.I looked for all structures that have a finalizer set and audited
their
.ptrusage, addingruntime.KeepAlive()s as necessary.This is probably a bit overkill, as the struct will stay alive
beyond most of those function calls, but IMO it's better to be
explicit here.