japronto icon indicating copy to clipboard operation
japronto copied to clipboard

Worker crashed on signal SIGABRT!

Open habibutsu opened this issue 6 years ago • 2 comments

The following script cause of crashing of server:

import sys
import asyncio
import asyncpg
import japronto


PG_DSN = 'postgres://postgres@localhost:5432'

app = japronto.Application()


async def init_db():
    app.db = await asyncpg.connect(dsn=PG_DSN, loop=app.loop)
    print('=> db connected')


async def hello(request):
    return request.Response(text='Hello world!')


if __name__ == '__main__':
    print(
        '=> versions:\n'
        f'python: {sys.version}\n'
        f'japronto: {japronto.__version__}'
    )
    app.router.add_route('/', hello)
    app.loop.run_until_complete(init_db())
    print('=> running')
    app.run(debug=True)

Output:

=> versions:
python: 3.6.1 (default, Apr 28 2017, 21:58:47)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)]
japronto: 0.1.1
=> db connected
=> running
Fatal Python error: Aborted

Current thread 0x00007fff99cbd380 (most recent call first):
  File "/Users/habibutsu/.pyenv/versions/pylibs3.6.1/lib/python3.6/site-packages/japronto/app/__init__.py", line 169 in serve
  File "/Users/habibutsu/.pyenv/versions/3.6.1/lib/python3.6/multiprocessing/process.py", line 93 in run
  File "/Users/habibutsu/.pyenv/versions/3.6.1/lib/python3.6/multiprocessing/process.py", line 249 in _bootstrap
  File "/Users/habibutsu/.pyenv/versions/3.6.1/lib/python3.6/multiprocessing/popen_fork.py", line 74 in _launch
  File "/Users/habibutsu/.pyenv/versions/3.6.1/lib/python3.6/multiprocessing/popen_fork.py", line 20 in __init__
  File "/Users/habibutsu/.pyenv/versions/3.6.1/lib/python3.6/multiprocessing/context.py", line 277 in _Popen
  File "/Users/habibutsu/.pyenv/versions/3.6.1/lib/python3.6/multiprocessing/context.py", line 223 in _Popen
  File "/Users/habibutsu/.pyenv/versions/3.6.1/lib/python3.6/multiprocessing/process.py", line 105 in start
  File "/Users/habibutsu/.pyenv/versions/pylibs3.6.1/lib/python3.6/site-packages/japronto/app/__init__.py", line 228 in _run
  File "/Users/habibutsu/.pyenv/versions/pylibs3.6.1/lib/python3.6/site-packages/japronto/app/__init__.py", line 264 in run
  File "hello_db.py", line 30 in <module>
Worker crashed on signal SIGABRT!

Note after deleting string with initialization of database everything works fine

habibutsu avatar Jun 18 '18 15:06 habibutsu