As a test I submitted a transaction built with invalid signatures:
Some("{\"result\":null,\"error\":{\"code\":-25,\"message\":\"Missing inputs\"},\"id\":517379}")
2018-08-14T13:26:17.847+00:00 - WARN - connection failed: request failed "HTTP/1.1 500 Internal Server Error": ["Content-Type: application/json", "Date: Tue, 14 Aug 2018 13:26:17 GMT", "Content-Length: 76"] = Some("{\"result\":null,\"error\":{\"code\":-25,\"message\":\"Missing inputs\"},\"id\":517379}")
2018-08-14T13:26:20.847+00:00 - WARN - connection failed: request failed "HTTP/1.1 500 Internal Server Error": ["Content-Type: application/json", "Date: Tue, 14 Aug 2018 13:26:20 GMT", "Content-Length: 76"] = Some("{\"result\":null,\"error\":{\"code\":-25,\"message\":\"Missing inputs\"},\"id\":517379}")
2018-08-14T13:26:23.848+00:00 - WARN - connection failed: request failed "HTTP/1.1 500 Internal Server Error": ["Content-Type: application/json", "Date: Tue, 14 Aug 2018 13:26:23 GMT", "Content-Length: 76"] = Some("{\"result\":null,\"error\":{\"code\":-25,\"message\":\"Missing inputs\"},\"id\":517379}")
2018-08-14T13:26:26.849+00:00 - WARN - connection failed: request failed "HTTP/1.1 500 Internal Server Error": ["Content-Type: application/json", "Date: Tue, 14 Aug 2018 13:26:26 GMT", "Content-Length: 76"] = Some("{\"result\":null,\"error\":{\"code\":-25,\"message\":\"Missing inputs\"},\"id\":517379}")
Electrs should return directly the error to the client.
Good catch!
The correct solution is to handle such errors differently than connection-related ones (which are handled by naive retries).
Note to self: there should be a specific handler for "transient" server errors, e.g. RPC_IN_WARMUP.
@gbenattar Please try the latest master branch - it should not get stuck on failing bitcoind RPC...
Closing the issue! Thanks @romanz.