Comments (6)
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.
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.
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.
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.
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.
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)
- Bump typer from 0.4.2 to 0.7.0 within Granian 0.3.0 release HOT 1
- Drop Python 3.7 support
- Upgrade PyO3 to 0.18
- Issue with using on par with poetry HOT 3
- HTTP/1.1 Upgrade to HTTP/2 not working HOT 5
- AsyncLibraryNotFoundError HOT 6
- ASGI Extension support HOT 9
- Interface asgi error with django HOT 4
- Implement ASGI extra `http.response.pathsend`
- Expose Rust interfaces
- Does not work on Raspberry Pi Zero HOT 5
- Disable loop optimisations as default behaviour
- Install error with pip HOT 4
- Bump pyo3 to 0.19 HOT 1
- Lock processes on windows to 1
- ASGI extensions support
- Add support for ASGI lifespan state
- RuntimeError: ASGI transport was closed HOT 2
- Support listening on UNIX domain sockets
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from granian.