Code Monkey home page Code Monkey logo

Comments (3)

minwoox avatar minwoox commented on June 3, 2024

If you enable this line, which sets the server error handler,
https://github.com/dlvenable/armeria-sample/blob/2bf911126d2610ab4284f0adbf177999e3ea59b3/src/main/java/io/venable/samples/armeria/request_timeout/RequestTimeoutExperiment.java#L60
408 is returned. Could you check that again, please? 🤔

from armeria.

dlvenable avatar dlvenable commented on June 3, 2024

@minwoox ,

Yes, I enabled that line and also added logging. I can see that it reaches the condition and returns the 408.

Ideally we would not be using a custom error handler to resolve this. It seems that the default error handler is not being used when the throttling strategy is enabled. Is that something you could do?

If we do have to enable a custom error handler, is there a way to get the default one so that we don't have to duplicate the conditions? It appears that the default error handler is package protected.

from armeria.

minwoox avatar minwoox commented on June 3, 2024

Ideally we would not be using a custom error handler to resolve this.

That is correct. 👍

It seems that the default error handler is not being used when the throttling strategy is enabled.

I'm not 100% sure but it seems like it's being used.
We haven't implemented returning 408 yet when the client doesn't set the request fully.

if (cause instanceof RequestTimeoutException) {
return internalRenderStatus(ctx, ctx.request().headers(),
HttpStatus.SERVICE_UNAVAILABLE, cause);

So I think the server returns 503 if you don't apply your custom error handler.
Let me ping you when #5579 is done so that you don't have to apply your own error handler. 😉

from armeria.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.