Commit Graph

71 Commits

Author SHA1 Message Date
Roland Bracewell Shoemaker ef54e932b5 Merge branch 'master' into rpc_problem_details 2015-11-23 11:12:14 -08:00
bifurcation ab19e33fec Merge branch 'master' into rpc-config-timeout 2015-11-21 20:15:42 -05:00
Jeff Hodges c5fdc7f769 allow ProblemDetails to be passed as RPC error
This allows us to return a for-users ProblemDetails from services that
the WFE calls (or services that those services call). Doing so means we
can give better errors to the WFE once we teach the WFE how to pass
along ProblemDetails itself.

This is for #1153 and a few other tickets in the error-messages label.

Fixes #1160
2015-11-20 16:39:51 -08:00
Jacob Hoffman-Andrews bdd3247f47 RPC debug logs don't use base64.
This decreases log size 27% in a simple test, and more importantly makes the
logs human readable and searchable.
Fixes #1031

Also, change corrID to an 8-byte value and break dependency on NewToken().
Fixes #909
2015-11-19 19:03:27 -08:00
Jacob Hoffman-Andrews 5fb7be64b0 Make ServiceQueue a separate config param.
Also, make clientName strings into constants.
2015-11-18 17:40:45 -08:00
Jacob Hoffman-Andrews 7dcfcd7864 Add configurable RPC timeouts per backend.
In the process, break out AMQP config into its own struct, one per service.
The AMQPConfig struct is included by composition in the config structs that need
it. If any given service lacks an AMQP config of its own, it gets a default
value from the top-level AMQP config struct, for deployability reasons.

Tightens the RPC code to take a specific AMQP config, not an over-broad
cmd.Config.

Shortens construction of specific RPC clients so they instatiate the generic
client connection themselves, simplifying per-service startup code.

Remove unused SetTimeout method on RPC clients.
2015-11-17 19:51:51 -08:00
Roland Shoemaker 77109fd60d Review fixes 2015-11-10 12:50:04 -08:00
Roland Shoemaker 88b8eb3480 Add RPC server processing metrics and rename client RPC metrics 2015-11-10 12:02:17 -08:00
Roland Shoemaker eb44c76c43 Switch from message type to server queue name 2015-11-08 18:37:57 -08:00
Roland Shoemaker ddb0b23603 Add StatsD metric for lag between message publishing and server processing 2015-11-08 17:46:01 -08:00
Jeff Hodges 09520058e1 remove RPC response chan from pending on timeout
This fixes a memory leak. On every request timeout, the pending map
would not have the have the request's response channel removed and,
instead, would hold on to it for the lifetime of the process. This
change makes sure the response channel is removed on timeout.

That change would cause "misrouted messages" audit logs to occur when a
response was sent back from a server but arrived past the timeout. That
would get pretty noisy. Since we introduced specific client queues, our
"misrouted messages" audit logs in the clients are always timeouts. So,
we solve the noisy log problem by deleting some code.

Fixes #1045.
2015-10-28 20:18:07 -07:00
Jacob Hoffman-Andrews 194e421931 Add reconnects in AMQP. 2015-10-27 19:54:54 -07:00
Richard Barnes 3637dfb0c1 ServiceUnavailableError 2015-10-21 16:25:43 -04:00
Richard Barnes 27bfee4513 Fix test failure from merge 2015-10-05 23:28:42 -04:00
bifurcation 90050e91f5 Merge branch 'master' into golint 2015-10-05 19:23:24 -04:00
bifurcation e7f47d4f09 Merge branch 'master' into golint 2015-10-05 00:14:29 -04:00
Roland Shoemaker 5d4fccabeb Merge master 2015-10-04 21:08:51 -07:00
Roland Shoemaker 4a98145992 Review fixes 2015-10-04 21:05:44 -07:00
Richard Barnes 14c3f297ef Fix golint in ./rpc 2015-10-04 20:57:36 -04:00
Jacob Hoffman-Andrews 6906e395a4 Pass RateLimitedError properly through RPC layer. 2015-10-03 22:59:28 -07:00
Roland Shoemaker 1c393b06bb Add maximum goroutine limit for RPC servers 2015-10-02 15:21:17 -07:00
Roland Shoemaker c22a21febb Parallelize RPC server message processing 2015-10-01 17:35:10 -07:00
Jacob Hoffman-Andrews 685c6e4206 Use stored key to verify JWS POSTs
instead of submitted key. This minimizes the chances of unexpected JWK fields in
the submitted key altering its interpretation without altering the lookup in the
registrations table.

In the process, fix handling of NoSuchRegistration responses.

Fixes https://github.com/letsencrypt/boulder/issues/865.
2015-09-29 23:37:16 -07:00
Roland Shoemaker 48bbd558a6 Fix imports 2015-09-17 18:20:47 -07:00
Roland Shoemaker 6c9c7bebcf Merge branch 'metrics-cleanup' of github.com:letsencrypt/boulder into metrics-cleanup 2015-09-15 12:03:25 -07:00
Roland Shoemaker 91750d925f Review fixes 2015-09-15 12:02:34 -07:00
Jeff Hodges d2b0579283 Merge branch 'master' into metrics-cleanup 2015-09-11 11:28:05 -07:00
Roland Shoemaker 7bad208513 Use RW lock for reading from pending map 2015-09-10 13:58:02 -07:00
Roland Bracewell Shoemaker 8a041240ba Merge branch 'master' into metrics-cleanup 2015-09-10 13:06:52 -07:00
Roland Shoemaker 00905ac07a Move RPCMonitor log to the RPCClient and do the collect natively 2015-09-10 12:48:35 -07:00
Roland Shoemaker 7808f8fc00 Set expiration on amqp.Publish calls, fixes #757 2015-09-09 13:46:07 -07:00
Roland Shoemaker 55eeec6ec7 Append rand ID to client queues 2015-09-02 12:58:20 -07:00
Roland Shoemaker 9d860d26b6 Log error type as well 2015-08-18 18:57:46 -07:00
Roland Shoemaker b100f81e0b Log body at debug 2015-08-18 18:57:00 -07:00
Roland Shoemaker cb918d1302 Always log errors passing through the RPC layer 2015-08-18 11:56:54 -07:00
Jeremy Gillula e64b555496 Now with more clear error messages! 2015-08-07 14:09:27 -07:00
Jeremy Gillula 00120e2106 Clarifying a comment: if the insecure flag is not set we default to assuming secure (and requiring AMQPS in the URL and the TLS config info to be set) 2015-08-07 14:06:51 -07:00
Jeremy Gillula d9b1f3d453 Added enforcement of AMQPS. If the insecure flag is true, then we also require the URL to be AMQPS and the TLS config info to be set, otherwise we fail out. If insecure is true, then we don't check for anything else. 2015-08-07 14:04:12 -07:00
Roland Shoemaker 8ad00b0025 Update NewAmqpRPCServer comment 2015-08-05 11:57:44 -07:00
Roland Shoemaker b495fa835e Remove unnecessary locking stuff, just return 2015-08-04 16:54:54 -07:00
Roland Shoemaker 8e04f64e27 Add missing lock 2015-08-04 16:40:30 -07:00
Roland Shoemaker 42135038d6 Add missing error catch 2015-08-04 16:28:01 -07:00
Roland Shoemaker 5ac7652ef4 Major rewrite 2015-08-04 16:23:49 -07:00
Roland Shoemaker 900a170fcd Review fixes and for loop cleanup 2015-08-04 11:38:16 -07:00
Roland Shoemaker c9c05cfb46 Add comments, move reconnection logic out of binaries (except for the WFE which is a weird case) 2015-08-03 23:02:52 -07:00
Roland Shoemaker 3d7992ae43 Add HandleInterrupts comment 2015-08-03 17:05:45 -07:00
Roland Shoemaker 85d037f7a7 Gracefully shutdown RPC servers 2015-08-03 16:47:47 -07:00
J.C. Jones 0e5f539e64 Remove the dead `rpc.amqpConnect` method. 2015-07-16 13:30:52 -07:00
J.C. Jones f71e36e114 Move DeclareExchange into its own method. 2015-07-16 13:30:52 -07:00
J.C. Jones 2eb51a1db8 426 - Support minimum permissions in AMQP
- Use Passive forms of ExchangeDeclare, QueueDeclare
- Write an example AMQP configuration tool, `docs/rabbitmq_acl_configure.sh`
2015-07-16 13:30:52 -07:00