Fork me on GitHub
#pedestal
<
2018-06-22
>
hlship00:06:03

I kind of remember seeing an issue that an async interceptor that adds a :response to the context doesn't trigger the leave state; I'm seeing this, where interceptor #1 adds a valid :response key to the context inside a go block, and interceptor #2 still executes normally (causing big problems for my app).

hlship00:06:41

I've added more logging, and in the enter of my second interceptor:

:parse-query :response {:status 400, :headers {}, :body {:errors [{:message "Stored query not found."}]}}
So my first interceptor is terminating correctly, by adding a valid :response key, but my second interceptor is still executing.

hlship00:06:04

With more logging:

05.558 DEBUG io.pedestal.interceptor.chain - {:interceptor :com.walmartlabs.lacinia.pedestal/query-source, :stage :enter, :execution-id 11, :fn #object[com.walmartlabs.lacinia.pedestal$pass_query_through_query_source$fn__26193 0x3fff323d "com.walmartlabs.lacinia.pedestal$pass_query_through_query_source$fn__26193@3fff323d"], :line 50}
:store-result #object[clojure.core.async.impl.channels.ManyToManyChannel 0x6778b666 "clojure.core.async.impl.channels.ManyToManyChannel@6778b666"]
:assoc-bad-request-response
05.559 DEBUG io.pedestal.interceptor.chain - {:in process-all, :handling :enter, :execution-id 11, :line 154}
05.560 DEBUG io.pedestal.interceptor.chain - {:interceptor :com.walmartlabs.lacinia.pedestal/query-parser, :stage :enter, :execution-id 11, :fn #object[com.walmartlabs.lacinia.pedestal$query_parser_interceptor$fn__26164 0x310e7b84 "com.walmartlabs.lacinia.pedestal$query_parser_interceptor$fn__26164@310e7b84"], :line 50}
:parse-query :response {:status 400, :headers {}, :body {:errors [{:message "Stored query not found."}]}}
05.561 DEBUG io.pedestal.interceptor.chain - {:in check-terminators, :terminate? true, :execution-id 11, :line 96}
05.561 DEBUG io.pedestal.interceptor.chain - {:in leave-all, :execution-id 11, :line 241}
I'd expect the :in check-temrinators to occur after the query-source interceptor, but it get delayed until the query-parser interceptor. The first is async, the second is standard.

hlship00:06:35

Note: this is in 0.5.3, I'm checking 0.5.4 now.

hlship02:06:03

Seems to be present in 0.5.4

ddeaguiar13:06:55

@U04VDKC4G sorry for the delayed response but I’ve been traveling. Not sure if you’ve opened a defect yet but I’ll try to reproduce later today. Thanks for posting the details of the issue!

hlship16:06:28

I've added an issue with the same detail, and more ... but I still could have sworn I saw a mention of this problem elsewhere. Maybe a new form of Deja Vue?