-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Realm updated in ResponseFilter is not honored #1094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This bug is not a priority for me, as I don't use ResponseFilters in Gatling. |
@slandelle So after mucking around with some failed tests, it looks like this is harder than I first expected. Both the ProxyUnauthorized407Interceptor and the Unauthorized401Interceptor modify the Realm and ProxyRealm on the returned future in all kinds of ways, which makes just substituting the new request's values not enough to preserve correct behavior. This would be a lot easier if those two interceptors were ResponseFilters, which modified the new request instead of the old response. Do you see any major obstacles to converting the various interceptor classes in the Interceptors class into RequestFiliters/ResponseFilters/IOExceptionFilters? Or am I biting off more than I can chew/over-complicating this simple issue? |
To be frank, I think that those RequestFilters/ResponseFilters/IOExceptionFilters are more or less broken.
|
Then, the Realm and auth layer needs some serious refactoring too :( |
Hmm, a lot to think about here. Let's see:
Yeah, I've been a little thrown off by the whole Filter vs AsyncHandler thing as well. Ostensibly, filters handle cross-cutting concerns that you wouldn't want to have to write over and over again. Examples include logging, exception handling, adding auth tokens to outbound requests, etc. Not sure if there are better, existing ways to tell the AsyncHttpClient "do this to every request you send, and do this to every response you receive". ResponseFilters and AsyncHandlers could probably be merged together, unless I'm missing something obvious, but RequestFIlters and IOExceptionFilters seem to provide a different set of capabilities.
My specialty! ;)
Yeah, performance is obviously critical to this application. BTW, is there a JMH test harness set up for this project? I see a lot of terrifying lazy initialization which implies that allocating an ArrayList is expensive, but I can never tell if that's a genuine optimization or just performance cargo culting. If there isn't one currently, setting that up might be something useful I could do, since it would make it much easier to empirically measure the performance changes of new PRs. Just a thought. |
Hi,
with 2.0.0-RC8 there seems to be a problem regarding
NettyRequestSender#newNettyRequestAndResponseFuture
. In a customResponseFilter
I replay the request with a Realm set. However this realm is ignored. Setting the realm data manually as header works. Debugging showed that the afore mentioned method uses the realm of the original future instead of the realm of the (changed) request.The text was updated successfully, but these errors were encountered: