apache / apache/pulsar-client-python

Segfaults in Python 3.11 on UWSGI worker close

Aberta
#153 8 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
75
Forks
53
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

We are using Python Pulsar producer clients in a web app that runs in UWSGI. We have our settings set to terminate and relaunch workers after a certain number of requests. We recently upgrade to Python 3.11 and the newest Pulsar client (3.3.0). At that point we started to see segfaults as the worker process was exiting. Here is the traceback that gets logged:

`!!! uWSGI process 85 got Segmentation Fault !!!
*** backtrace of 85 ***
uwsgi(uwsgi_backtrace+0x2f) [0x556ab933fcaf]
uwsgi(uwsgi_segfault+0x23) [0x556ab9340083]
/lib/x86_64-linux-gnu/libc.so.6(+0x3bfd0) [0x7f845c457fd0]
/usr/local/lib/python3.11/site-packages/pulsar_client.libs/libpulsar-2dce0d9f.so(+0x2b387a) [0x7f845770087a]
/usr/local/lib/python3.11/site-packages/_pulsar.cpython-311-x86_64-linux-gnu.so(+0xaf752) [0x7f8457f99752]
/usr/local/lib/python3.11/site-packages/_pulsar.cpython-311-x86_64-linux-gnu.so(+0x5399e) [0x7f8457f3d99e]
/usr/local/lib/python3.11/site-packages/_pulsar.cpython-311-x86_64-linux-gnu.so(+0x545ef) [0x7f8457f3e5ef]
/usr/local/lib/libpython3.11.so.1.0(+0x228f8a) [0x7f845c825f8a]
/usr/local/lib/libpython3.11.so.1.0(+0x1f4467) [0x7f845c7f1467]
/usr/local/lib/libpython3.11.so.1.0(+0x1f4030) [0x7f845c7f1030]
/usr/local/lib/libpython3.11.so.1.0(+0x29941f) [0x7f845c89641f]
/usr/local/lib/libpython3.11.so.1.0(+0x2993c5) [0x7f845c8963c5]
/usr/local/lib/libpython3.11.so.1.0(+0x1ed587) [0x7f845c7ea587]
/usr/local/lib/libpython3.11.so.1.0(_PyModule_ClearDict+0x115) [0x7f845c82bfe5]
/usr/local/lib/libpython3.11.so.1.0(+0x278bb6) [0x7f845c875bb6]
/usr/local/lib/libpython3.11.so.1.0(Py_FinalizeEx+0x12b) [0x7f845c8616ab]
uwsgi(uwsgi_plugins_atexit+0x71) [0x556ab933e121]
/lib/x86_64-linux-gnu/libc.so.6(+0x3e4dd) [0x7f845c45a4dd]
/lib/x86_64-linux-gnu/libc.so.6(+0x3e61a) [0x7f845c45a61a]
uwsgi(+0x3df6f) [0x556ab92f5f6f]
uwsgi(simple_goodbye_cruel_world+0x59) [0x556ab933f619]
uwsgi(+0x87658) [0x556ab933f658]
uwsgi(uwsgi_close_request+0x4d9) [0x556ab92f6bf9]
uwsgi(simple_loop_run+0xc0) [0x556ab933bbc0]
uwsgi(simple_loop+0x7b) [0x556ab933bc8b]
uwsgi(uwsgi_ignition+0x279) [0x556ab93403b9]
uwsgi(uwsgi_worker_run+0x25b) [0x556ab93449db]
uwsgi(uwsgi_run+0x43a) [0x556ab9344f2a]
uwsgi(+0x3aede) [0x556ab92f2ede]
/lib/x86_64-linux-gnu/libc.so.6(+0x271ca) [0x7f845c4431ca]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x85) [0x7f845c443285]
uwsgi(_start+0x21) [0x556ab92f2f01]
*** end of backtrace ***`

The resulting core files are filling up the server disks. We could ulimit them but we'd prefer to avoid that.

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Comece reproduzindo a combinação de Python 3.11 e Pulsar client 3.3.0 sob uWSGI com reciclagem de workers e, em seguida, inspecione o caminho de shutdown envolvendo _pulsar e libpulsar a partir do backtrace. Considera-se concluído quando os workers são encerrados sem segmentation faults e nenhum arquivo core é gerado durante a reciclagem normal.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
python
Domínio
backend, distributed-systems
Tipo de issue
Bug
Dificuldade
4/5
Tempo estimado
3-5 dias
Status de atividade
Estagnada
Clareza
Precisa de esclarecimento
Facilidade para iniciantes
25/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.