Skip to content
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

Filter invoked 4 times per single request? #69

Closed
savaki opened this issue Nov 3, 2013 · 2 comments

Comments

@savaki
Copy link
Contributor

commented Nov 3, 2013

Using the ugly patch described previously, I've added a single filter to the application. When tracing the filter, I see that it gets invoked 4 times per http request. I've verified that I'm indeed only making 1 http request and not 4. Any idea what's going on here?

Here's a fragment of a stack trace that I captured that shows the caller of the filter:

com.twitter.finagle.Filter$$anon$2.apply(Filter.scala:69)
com.twitter.finagle.Service$$anon$1.apply(Service.scala:14)
com.twitter.finatra.FileService.apply(FileService.scala:121)
com.twitter.finatra.FileService.apply(FileService.scala:85)
com.twitter.finagle.Filter$$anon$2.apply(Filter.scala:69)
com.twitter.finagle.Service$$anon$1.apply(Service.scala:14)
com.twitter.finatra.LoggingFilter.apply(LoggingFilter.scala:11)
com.twitter.finatra.LoggingFilter.apply(LoggingFilter.scala:8)
com.twitter.finagle.Filter$$anon$2.apply(Filter.scala:69)
com.twitter.finagle.Service$$anon$1.apply(Service.scala:14)
com.twitter.finagle.Service$$anon$1.apply(Service.scala:11)
com.twitter.finatra.FinatraServer$$anonfun$2.apply(FinatraServer.scala:59)
com.twitter.finatra.FinatraServer$$anonfun$2.apply(FinatraServer.scala:58)
com.twitter.finagle.Filter$$anon$6.apply(Filter.scala:117)
com.twitter.finagle.Filter$$anon$2.apply(Filter.scala:69)
com.twitter.finagle.ServiceProxy.apply(Service.scala:103)
com.twitter.finagle.Service$$anon$1.apply(Service.scala:14)
com.twitter.finagle.Filter$$anon$4.apply(Filter.scala:111)
com.twitter.finagle.Filter$$anon$5$$anon$1.apply(Filter.scala:53)
com.twitter.finagle.service.StatsFilter.apply(StatsFilter.scala:34)
com.twitter.finagle.Filter$$anon$5.apply(Filter.scala:52)
com.twitter.finagle.Filter$$anon$2.apply(Filter.scala:69)
com.twitter.finagle.Service$$anon$1.apply(Service.scala:14)
com.twitter.finagle.tracing.ServerDestTracingProxy$$anon$1.apply(DestinationTracing.scala:26)
com.twitter.finagle.Filter$$anon$2.apply(Filter.scala:69)
com.twitter.finagle.Service$$anon$1.apply(Service.scala:14)
com.twitter.finagle.filter.MkJvmFilter$$anon$1.apply(JvmFilter.scala:29)
com.twitter.finagle.Filter$$anon$5$$anon$1.apply(Filter.scala:53)
com.twitter.finagle.tracing.TracingFilter$$anonfun$apply$1.apply(TracingFilter.scala:18)
com.twitter.finagle.tracing.TracingFilter$$anonfun$apply$1.apply(TracingFilter.scala:16)
com.twitter.finagle.tracing.Trace$.unwind(Trace.scala:183)
com.twitter.finagle.tracing.TracingFilter.apply(TracingFilter.scala:16)
com.twitter.finagle.Filter$$anon$5$$anon$1.apply(Filter.scala:53)
com.twitter.finagle.filter.MonitorFilter$$anonfun$apply$1.apply(MonitorFilter.scala:16)
com.twitter.finagle.filter.MonitorFilter$$anonfun$apply$1.apply(MonitorFilter.scala:16)
com.twitter.util.Future$$anonfun$monitored$1.apply$mcV$sp(Future.scala:93)
com.twitter.util.Monitor$$anonfun$apply$1.apply$mcV$sp(Monitor.scala:38)
com.twitter.util.Monitor$$anonfun$apply$1.apply(Monitor.scala:38)
com.twitter.util.Monitor$$anonfun$apply$1.apply(Monitor.scala:38)
com.twitter.util.Monitor$$anonfun$using$1.apply(Monitor.scala:103)
com.twitter.util.Monitor$.restoring(Monitor.scala:110)
com.twitter.util.Monitor$.using(Monitor.scala:101)
com.twitter.util.Monitor$class.apply(Monitor.scala:37)
com.twitter.util.Monitor$$anon$1.apply(Monitor.scala:141)
com.twitter.util.Future$.monitored(Future.scala:92)
com.twitter.finagle.filter.MonitorFilter.apply(MonitorFilter.scala:15)
com.twitter.finagle.Filter$$anon$5$$anon$1.apply(Filter.scala:53)
com.twitter.finagle.filter.HandletimeFilter.apply(HandletimeFilter.scala:15)
com.twitter.finagle.Filter$$anon$5.apply(Filter.scala:52)
com.twitter.finagle.Filter$$anon$5.apply(Filter.scala:52)
com.twitter.finagle.Filter$$anon$5.apply(Filter.scala:52)
com.twitter.finagle.Filter$$anon$2.apply(Filter.scala:69)

@grandbora

This comment has been minimized.

Copy link
Contributor

commented Nov 4, 2013

Hey @savaki I recently did a bugfix on filters. It is hard to come up with something by looking at stack trace, if you post some code I would try to to help.

@savaki

This comment has been minimized.

Copy link
Contributor Author

commented Nov 4, 2013

hmmm ... having a hard time reproducing it on the latest. I'll keep an eye on it.

@savaki savaki closed this Nov 4, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.