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

(SERVER-391) Throw slingshot exception on timeout #505

Conversation

dankreek
Copy link
Contributor

No description provided.

@dankreek dankreek force-pushed the SERVER-391/provide-better-error-message-for-borrow-timeout branch from 0b32372 to a0b2310 Compare April 17, 2015 00:35
(let [path (get-route this)
config (get-config)
certname (get-in config [:puppet-server :certname])
localcacert (get-in config [:puppet-server :localcacert])
Copy link
Contributor

Choose a reason for hiding this comment

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

extra spaces in the get-in args on these two lines

[puppetlabs.services.jruby.jruby-puppet-service :as jruby]
[puppetlabs.trapperkeeper.services :as tk-services]))
[clojure.tools.logging :as log]))

(defn- handle-request
Copy link
Contributor

Choose a reason for hiding this comment

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

This whole function should be removed now, right, since nothing should be calling it?

@camlow325
Copy link
Contributor

👍 other than egregious Wolfe Principle™ violations.

@dankreek
Copy link
Contributor Author

All Wolfe Principle violations have been addressed.

@camlow325
Copy link
Contributor

👍 @KevinCorcoran, you good with this?

@KevinCorcoran
Copy link
Contributor

Sorry y'all, I won't have time to look at this until next Thursday. But you can feel free to merge it without waiting on me, I'm satisfied that we got to the bottom of the namespaced-keyword mystery. 🔍

@camlow325
Copy link
Contributor

Well, here it is "next Thursday" and we still haven't merged this. @KevinCorcoran - you still have time to take a quick pass at this and see if it looks reasonable to merge?

[request jruby-service config]
(jruby/with-jruby-puppet jruby-puppet jruby-service
(core/handle-request request jruby-puppet config)))

Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you make this change? I try to keep interactions with services contained within "service" namespaces - which was the origin reason for getting the jruby-puppet instance here, instead of passing the JRuby service reference down into handle-request.

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess it's a convention/style thing, but I find it a bit odd to see service references being passed around into namespaces that otherwise have nothing to do with Trapperkeeper. (e.g. request-handler-core). Makes it a bit more onerous to test, etc.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, @dankreek and I talked about that and waffled a bit.

I had found it a bit odd to be doing more seemingly domain specific logic like getting a jruby-puppet instance and possibly construct a ring response from the service namespace rather than core, which I kind of thought was where @cprice404 was on this as well.

I don't have a strong opinion on this, though - other than that I want to get this PR in soon so we can move on.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, in this case we either err on the side of putting a "service" thing in core code, or do core things in service code. This solution ended up being the least ugly, in my opinion.

Copy link
Contributor

Choose a reason for hiding this comment

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

I misunderstood what was going on here; this LGTM.

KevinCorcoran added a commit that referenced this pull request Apr 23, 2015
…-message-for-borrow-timeout

(SERVER-391) Throw slingshot exception on timeout
@KevinCorcoran KevinCorcoran merged commit 084a1d2 into puppetlabs:stable Apr 23, 2015
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.

None yet

5 participants