Function timeouts traced to Connection library

I’ve got a stack that uses OrientDB, and therefore uses the MarcoPolo library as a driver (https://github.com/MyMedsAndMe/marco_polo). MarcoPolo uses Connection for TCP connections to the database (https://github.com/fishcakez/connection). I’ve written a small wrapper around MarcoPolo that provides pooling with Poolboy.

About 20% of our database queries are failing at this point. The only indication of an error that we get is the following:

erlang error: {:timeout, {:gen_server, :call, [#PID<0.1700.0>, {:operation, :command, [{:raw, "s"}, 81, {:raw, <<0, 0, 0, 1, 113>>}, {:raw, [<<0, 0, 0, 44, 83, 69, 76, 69, 67, 84, 32, 101, 120, 112, 97, 110, 100, 40, 111, 117, 116, 40, 39, 114, 101, 112, 108, 121, 95, 116, 111, 39, 41, 41, 32, 70, 82, 79, ...>>, <<255, 255, 255, 255>>, <<0, 0, 0, 0>>, [<<0, 0, 0, 16>>, [0, [[<<0>>, ""], [[[["\f", "params"], <<0, 0, 0, 15>>, 12]], 0, [[<<0>>, [], []]]]]]]]}]}, 5000]}}


gen_server.erl:212 :in `call`
lib/marco_polo.ex:831 :in `refetching_schema`
lib/ex_orient/db.ex:29 :in `-command/2-fun-0-`
src/poolboy.erl:76 :in `transaction`
web/controllers/message_controller.ex:489 :in `get_question`
web/controllers/message_controller.ex:253 :in `-do_filter/1-fun-1-`
timer.erl:166 :in `tc`
web/controllers/message_controller.ex:1 :in `do_filter`

I’ve followed this to a Connection.call function call in MarcoPolo. I suppose it’s possible that actual TCP requests to the database are failing, but I can’t seem to replicate this problem to debug it. Any push it the right direction would be much appreciated.