GithubHelp home page GithubHelp logo

Rocket App Hangs about rocket HOT 5 CLOSED

danbugs avatar danbugs commented on June 2, 2024
Rocket App Hangs

from rocket.

Comments (5)

SergioBenitez avatar SergioBenitez commented on June 2, 2024

There is a known issue with tokio that can cause this under certain conditions. Please see #2239. Does this sound like your problem?

from rocket.

danbugs avatar danbugs commented on June 2, 2024

I don't think this is the same issue, because my app hangs even on a simple "Hello, World!" return, and my route is as simple as:

#[get("/")]
fn index() -> &'static str {
    "Hello, world!"
}

Here's a video demo:
video-demo

from rocket.

danbugs avatar danbugs commented on June 2, 2024

Huh, never mind - I think this was actually not Rocket's fault. For context, I had my backend deployed on a Kubernetes cluster of Raspberry Pis and was accessing the backend through a NodePort service. I noticed that if I exec into the pod and curled it... It would never hang! So, to experiment, I tried swapping the NodePort for a LoadBalancer, and that did it πŸ˜…

This must be a problem w/ K3S's implementation of NodePorts. I'm closing the issue - thanks for the supportπŸ‘

from rocket.

SergioBenitez avatar SergioBenitez commented on June 2, 2024

Looking at your source code, this does seem to also be an instance of that, you're just not hitting it yet. You're using diesel, the synchronous version, in an asynchronous context. This will block. You simply cannot mix sync and async code, especially when there's I/O. For diesel, you must use diesel_async. Note that this isn't Rocket specific - this is the case for any async Rust application.

from rocket.

danbugs avatar danbugs commented on June 2, 2024

I don't think it should block when hitting my "Hello, World!" route though, no? Regardless, if the problem comes back, I'll make sure to change that. I appreciate your comment :)

from rocket.

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.