Skip to content
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

If we GC while adding, the temporary root will never be unpinned. #4625

Open
Stebalien opened this issue Jan 30, 2018 · 7 comments
Open

If we GC while adding, the temporary root will never be unpinned. #4625

Stebalien opened this issue Jan 30, 2018 · 7 comments
Labels
kind/bug A bug in existing code (including security flaws) topic/files Topic files topic/repo Topic repo

Comments

@Stebalien
Copy link
Member

We should pin, unlock, gc, lock, and unpin immediately. This is a bug in maybePauseForGC in coreunix/add.go.

@ghost
Copy link

ghost commented Jan 30, 2018

@Stebalien mind adding labels to all these new issues? They're great, it'll just make them more discoverable.

@victorb
Copy link
Member

victorb commented Jan 30, 2018

Speaking about triaging, @forstmeier have reached out and offered us to try out a automatic labeling feature for Github Issues. Might be useful for us. The website for the service is here: https://heupr.io/

Maybe we could try it out with ipfs/go-ipfs and if everything works fine, use it for other repos as well.

@forstmeier how does heupr work with lots of repositories? Will the trained models be using information for the entire organization or just one repository?

@Stebalien Stebalien added the kind/bug A bug in existing code (including security flaws) label Jan 30, 2018
@Stebalien
Copy link
Member Author

I worry about services like that as I'm pretty sure we'll need to give the service write access to the repo (welcome to github's lack of useful permissions...).

@lgierth sorry about that.

@Stebalien Stebalien added the topic/files Topic files label Jan 30, 2018
@Kubuxu
Copy link
Member

Kubuxu commented Jan 31, 2018

@Stebalien Just checked it, it doesn't require access to code:
83b

@victorbjelkholm do we have an issue somewhere about this, if not could you open one?

@ghost ghost added the topic/repo Topic repo label Jan 31, 2018
@Stebalien
Copy link
Member Author

Ah. So github allows one to give bots fine-grained access but not users? ...

@victorb
Copy link
Member

victorb commented Feb 1, 2018

@Kubuxu sorry for the unrelated comments, we can continue the discussion in https://discuss.ipfs.io/t/ipfs-issue-triage/1548

@taylormike
Copy link

@Stebalien Something like this? (see adder.UnpinRoot())

func (adder *Adder) maybePauseForGC() error {
	if adder.unlocker != nil && adder.blockstore.GCRequested() {
		//Pin Root			
		err := adder.PinRoot()
		if err != nil {
			return err
		}
		//GC is unlocked		
		adder.unlocker.Unlock() 
		//GC is now running...
		//GC is locked
		adder.unlocker = adder.blockstore.PinLock()
		//Unpin Root		
		err = adder.UnpinRoot() //<-New Method
		if err != nil {
			return err
		}
	}
	return nil
}

// Unpins the root node of Adder
func (adder *Adder) UnpinRoot() error {
	root, err := adder.RootNode()
	if err != nil {
		return err
	}
	if !adder.Pin {
		return nil
	}

	rnk := root.Cid()

	err = adder.pinning.Unpin(adder.ctx, rnk, true)
	if err != nil {
		return err
	}
	return adder.pinning.Flush()
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) topic/files Topic files topic/repo Topic repo
Projects
None yet
Development

No branches or pull requests

4 participants