-
Notifications
You must be signed in to change notification settings - Fork 8
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
move close into non error block and defer it #2
base: master
Are you sure you want to change the base?
Conversation
@mcqueenorama this patch is going to cause a memory leak. defer res.Body.Close() wont be called since we're in a for loop. The way I had it also fails now that I look at it. When you say the "host was not in DNS" are you talking about failing to reach the host (i.e. your network is down?) |
You are right, I guess drop the defer. I added it as an afterthought, but its wrong. Regarding the DNS comment, I think I tested by putting in a stupid dbs name, and i also tested it by pointing at localhost to some unused port. Anyway, you can see the problem I was worrying about. BTW Its a fun and useful tool. I've got it watching the flapjack server as a second tier backup. If flapjack goes down this will notify me. I was thinking of adding stuff like handlers, but there's plenty of fancy stuff out there. I like the simplicity of this. |
I just pushed up some code changes per your pull request. Take a look and see if they fix your issue (I tested it and it works on my end). I will then prepare a build for release. Thanks for the positive feedback on the project too. This was actually my first Go program. I was evaluating several languages to figure out which one I wanted to jump into next, and I feel in love with Go after building lilpinger. The whole goal was to not have too many bells and whistles while being an useable tool. I'm glad you appreciate that. It's easy to get carried away as a developer. ;-) |
It looks good! I just did my first small go projects too - a few nagios https://github.com/chrislusf/weed-fs On Tue, Nov 25, 2014 at 12:15 PM, Alexander Rolek [email protected]
the news wire of the 21st century - twitchy.com |
I just pushed up a new release with the fixes. thanks again for reporting them. that's quite the project you're building. what's the motivation? personal exploration or did you have a business problem that needed solving? |
That one's not mine. Its my favorite, and I wish I'd thought of it myself. I intend to use it for probably many different use cases. Its a distributed http based file system. Its an implementation of Facebook's Haystack. If you want to access objects via http and want them replicated in a cloud, it makes it trivial to jam objects in and they replicate to the cloud and they are immediately and simply accessible via http. For instance images for a web site and you want them replicated to data centers around the world. Publish them trivially via http to weed-fs, and they go around the world and are accessible immediately via http. |
It's just for fun but I do want to put it to work in the business too. I'm On Wednesday, November 26, 2014, Alexander Rolek [email protected]
the news wire of the 21st century - twitchy.com |
I see. It looks like a pretty amazing tool. I don't currently have use for it. For storage needs I typically use S3, which also has it's downsides. Keep me in the loop as you play with the tool though. I always like to keep up with these types of distributed systems. That's great Walmart Labs is allowing you to play with Go. I think the language is well positioned and will be adopted by enterprises in the not to distant future. ;-) |
I found that if the a host was not in dns then the req close was causing a panic.