Handle async servlet dispatch and streaming responses in Logbook filter#2249
Conversation
|
As commented here: #2248 (comment) I was expecting this build to fail on coverage, but I need some input to see if we can even get rid of this branch altogether? WDYT? |
f270c12 to
34a66a7
Compare
|
I've added a very convoluted test to imitate a duplicate call to |
|
@kasmarian (just picking one of the maintainers here): there is some code in RemoteRequest to attach the listener when Can we just get rid of that code in favor of https://github.com/aukevanleeuwen/logbook/blob/34a66a72c34df2b335f4419d378f5bcaf0148c0b/logbook-servlet/src/main/java/org/zalando/logbook/servlet/LogbookFilter.java#L76? |
|
A very interesting find, @aukevanleeuwen! I tried finding a way to break it without the AtomicBoolean, but seems like the flow works fine with your changes, as it should have from the beginning, is seems. As AtomicBoolean was just patching a bug. Feel free to remove it in this PR. The concern I had was that in case of these multi-step flows, LogbookFilter would be called several times with different AsyncContexts, each of which would trigger completion events and result in multiple duplicated log writes. But it looks like eventually only one onComplete. The flow with the internally forwarded request from the test that you added looked like:
asyncStarted = false |
34a66a7 to
f2f88ec
Compare
|
@kasmarian I've rebased and removed the synchronizer code (and the async listener code in |
|
@lukasniemeier-zalando @kasmarian @msdousti @ChristianLohmann Any chance this can have another review? TIA. |
|
sorry, somehow half of the logbook maintainers got sick last week. The changes look good to me |
|
👍 |
|
@lukasniemeier-zalando @msdousti @ChristianLohmann Can one of you do another review perhaps? |
|
👍 |
|
@kasmarian : do you have a release cadence of some kind by any chance? |
|
Hey @kasmarian, that would be nice if possible. I can understand you want to batch them together, but to be honest it doesn't look like they will be done very soon. But maybe I'm mistaken. If they are close to finishing, fine. Otherwise I'd love to have a release earlier. |
|
Let me check with a few people how close they feel their PR reviews are and do a release later this week either with other changes or not |
I've opened a discussion here: #2248 with some more details surrounding this PR.