Add tracker interface and tests #3
No reviewers
Labels
No Label
Copied from Github
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cerc-io/eth-iterator-utils#3
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "tracker-interface"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Refactors the tracker to expose an interface and an implementation type. Decoupling these will let us inject new state/functionality transparently to the client function (like the iterator metrics for cerc-io/ipld-eth-state-snapshot#1).
@ -145,1 +181,3 @@
func (tr *Tracker) HaltAndDump() error {
// CloseAndSave stops all tracked iterators and dumps their state to a file.
// This closes the tracker, so adding a new iterator will fail.
func (tr *TrackerImpl) CloseAndSave() error {
Is it explicit anywhere that you must call CloseAndSave in order to close the channel, set running to false, etc?
What happens if you don't call that, but the iterator completes?
If we need to call it, I think the pattern:
Needs to be documented explicitly somewhere (unless I am just missing something).
If it's not called, it should just be sort of a leak. The channels won't be flushed or saved, but once all its iterators die, the tracker will still be gc'd. No critical consequences that I foresee, but I will document it.
@ -175,3 +206,4 @@
ret := it.NodeIterator.Next(descend)
if !ret {
it.tracker.RLock()
Why not call
it.StopIterator()
? I am always nervous about code that requires a precise locking scheme being duplicated multiple places.That's fair - I don't think we actually need StopIterator any more, so I will just delete it for now.