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

Added ReregisterInstance to allow registering over an existing registrat... #4

Merged
merged 5 commits into from
Jun 9, 2014

Conversation

cquinn
Copy link
Contributor

@cquinn cquinn commented Jun 3, 2014

...ion

Added DeregisterInstance to all deregistration
Added UpdateInstanceStatus to allow an instance to be taken out of service
Other rpc and struct changes to match.

Let me know if you think you'd like these changes back and I'll write the tests to go with them. (I'll probably write the test anyway :)

…ration

Added DeregisterInstance to all deregistration
Added UpdateInstanceStatus to allow an instance to be taken out of service
Other rpc and struct changes to match.
@@ -135,6 +143,47 @@ func (e *EurekaConnection) RegisterInstance(ins *Instance) error {
return nil
}

// DeregisterInstance will register the given Instance with eureka but DOES
// NOT automatically send heartbeats. See HeartBeatInstance for that
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll need to update these godocs before I can merge this in.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, sure thing. Missed that one.

@ryansb
Copy link
Contributor

ryansb commented Jun 3, 2014

I'd definitely like to merge these back in, it'd be great if you could write tests for your additions.

Thanks!

@cquinn
Copy link
Contributor Author

cquinn commented Jun 6, 2014

I have written tests, but am having trouble getting the vagrant env with eureka working. The gradle build failed, so I just pulled a binary from the jenkins job linked from the eureka github. But it's giving me 404's on all requests, so that's not good. I'll keep working on that, but let me know if you have any hints..

@cquinn
Copy link
Contributor Author

cquinn commented Jun 6, 2014

Figured out the 404 problem: the vagrant nodes didn't get their eurekas. Now it seems that the eurekas are running, but don't see each other, and then a bunch of the tests fail because of that.

Could you add a little more info on the steps to setup and run the tests? I'm guessing that I need to have the eurekas know about their node*.localdomain names, so I'll try that next...

(I had been doing development against a cluster we have internally, and hadn't tried setting up a vagrant harness like this, so please excuse my dumb questions.)

@ryansb
Copy link
Contributor

ryansb commented Jun 6, 2014

I'll add more instructions to the tests. So far they've only really been run on my local setup, so I appreciate the feedback.

@ryansb
Copy link
Contributor

ryansb commented Jun 6, 2014

@cquinn I've added testing instructions at https://github.com/hudl/fargo#testing and I've updated the vagrant provisioning script to use the eureka build from Netflix's cloudbees page.

Let me know if the tests work on your vagrant installation.

@cquinn
Copy link
Contributor Author

cquinn commented Jun 6, 2014

Thanks Ryan, that helped a lot, and my Vagrant Eurekas are running well now.

The tests all work except the TestMetadataReading which fails with:

  * /Users/cquinn/ws/go/src/github.com/hudl/fargo/tests/net_test.go
  Line 162:
  Expected: 'AValue'
  Actual:   ''
  (Should be equal)

(my line numbers are different)

It looks like the call to GetString() after the AddMetadataString call ends up doing a parse() which wipes out the parsed map since Raw was never set. Does this test work for you?

@ryansb
Copy link
Contributor

ryansb commented Jun 6, 2014

It does work for me, you may have to run in twice (separated by 20 seconds or so) for it to pass. I believe the syncing between eureka servers occasionally causes that test to fail.

@cquinn
Copy link
Contributor Author

cquinn commented Jun 6, 2014

Ah, it now works after a second run. I still don't see how the instance metadata is read back: probably via readAppInto() but I don't see where that is enabled for the tests. Not a big deal.

I'll clean up my files and prepare another PR later today.

cquinn added 3 commits June 6, 2014 15:34
… TestDeregistration, TestUpdateStatus.

Although I had to turn off TestDeregistration since that triggers flakiness in other tests.
Also removed first So() in TestMetadataReading since that was causing Convey errors for me and since that
path is already tested in TestConnectionCreation which I moved to earlier in the file.
@cquinn
Copy link
Contributor Author

cquinn commented Jun 6, 2014

OK, all done, ready for merge I hope.

ryansb added a commit that referenced this pull request Jun 9, 2014
Added ReregisterInstance courtesy of @cquinn
@ryansb ryansb merged commit 81866b7 into hudl:master Jun 9, 2014
@ryansb
Copy link
Contributor

ryansb commented Jun 9, 2014

Looks great, thanks!

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

Successfully merging this pull request may close these issues.

2 participants