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

Diff sometimes errors out with the message "both left and right were nil for diff" #225

Open
gotwarlost opened this issue Mar 2, 2021 · 4 comments

Comments

@gotwarlost
Copy link
Contributor

Race condition where an object is deleted between the time it is LIST-ed versus the time it is GET-ted

@gotwarlost
Copy link
Contributor Author

@sherman-grewal something easy to start with

@sherman-grewal
Copy link

sherman-grewal commented Jul 6, 2021

I can't seem to reproduce this error, would you happen to have any ideas on how I can reproduce it?

This is what I've done so far (in an attempt to reproduce the error).

  1. Start with the demo project: qbec init demo --with-example
  2. Run qbec apply default to create the objects
  3. Add the following code somewhere between the time it is LIST-ed versus the time it is GET-ted when we run qbec diff default

internal/commands/diff.go:diff()

if ob.GetName() == "demo-deploy" {
	cmd := exec.Command("./test.sh")
	err := cmd.Run()
	if err != nil {
		return err
	}
}

test.sh

#!/bin/bash

kubectl delete deployments/demo-deploy
  1. Run qbec diff default

I thought by deleting the deployment object between the time it is LIST-ed versus the time it is GET-ted would reproduce the issue, but it does not seem to be the case. Let me know if I am missing something!

@gotwarlost

@gotwarlost
Copy link
Contributor Author

kubectl delete deploy probably doesn't wait for the deployment object to be removed - the pod has to go away first etc. Try sleeping for 30s or smth after running the delete

@harsimranmaan
Copy link
Contributor

use kubectl delete deployments/demo-deploy --wait=true in the script. Also remove the demo-deploy deployment from components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants