done = Channel(Nil).new
# print contentwhentimeout(34.seconds)
# how to print stack traceto investigate which code causes long processing
raise"Server could not process_request in 34 seconds"end
for what reason?
I don't know it is because of db, or pooling or business logic processing...
the call_next(context) is more or less like your Athena's Controller
@Dan-Do there is no way, timeout will happen on channel, so it got no relation with any specific fiber
not entirely, thats more of how the other frameworks work. I.e. an Array(HTTP::Handler)
what you need is detailed logging inside your logic, so that you can capture detailed information and see what is happening or what is causing the delay
Ok I will go with logging. Can I narrow the log by just logging the fibers which has running time longer than ex 30.seconds
I don't see any method like Fiber.current.running_time
simple approach would be
start the timer before you call call_next
Log fiber-id and other specific details like what work its doing
after method returns, log the time it took to process the request