Coder Social home page Coder Social logo

Comments (6)

gi0baro avatar gi0baro commented on July 25, 2024

Looks like you're passing your application instance as the app parameter, while that argument should be a string referring to where to import your application from.

from granian.

albertoreis86 avatar albertoreis86 commented on July 25, 2024

not really actually,
this is how I instantiate:

granian = Granian(target=f'{settings.APPLICATION_PATH}',
address=settings.SERVER_HOST,
port=settings.PORT,
interface=constants.Interfaces.ASGI,
workers=settings.WORKERS_NUMBER,
log_level=log.LogLevels.debug if settings.DEBUG else log.LogLevels.info,
ssl_cert=cert_file_path if cert_file_path.exists() else None,
ssl_key=cert_keyfile_path if cert_keyfile_path.exists() else None,
reload=settings.RELOAD_SERVER,
log_dictconfig=logging_config)
granian.serve()

from granian.

gi0baro avatar gi0baro commented on July 25, 2024

That's strange 🤔

What kind of application is that? Have you ever successfully run it with another server and workers > 1?
Also it sounds confusing to me the stacktrace looks like it's macOs, but instead of using spawn as the multiprocessing context (which is the default under macOs) it uses fork.

from granian.

albertoreis86 avatar albertoreis86 commented on July 25, 2024

Yes we use to run this with hypercorn and was going ok.,
indeed it is macOS, the other members of the team can run it normally using linux.
the default value for workers number is 1.

from granian.

gi0baro avatar gi0baro commented on July 25, 2024

Ok so probably if you call:

import multiprocessing
multiprocessing.set_start_method('fork')

you should be able to run it in the same way it works on Linux.

What it still sound strange to me, is why you have an _io.TextIOWrapper instance defined somewhere before starting granian. It sounds like you opened a file or a stream and never closed it, or never parsed the context of that stream. Probably just a str(variable) would make the thing pickable.

from granian.

albertoreis86 avatar albertoreis86 commented on July 25, 2024

Thanks @gi0baro it worked explicitly setting the start method to fork.
I will dig into the _io.TextIOWrapper I will dig into it.
Thanks

from granian.

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.