# Django 4.2.16 + Daphne 4.1.2 http requests timeout result main thread deadlock

**URL:** <https://forum.djangoproject.com/t/django-4-2-16-daphne-4-1-2-http-requests-timeout-result-main-thread-deadlock/38835>\
**Category:** Async/Channels\
**Created:** [February 14, 2025, 5:55am UTC](https://forum.djangoproject.com/t/django-4-2-16-daphne-4-1-2-http-requests-timeout-result-main-thread-deadlock/38835 "2025-02-14T05:55:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![luxiaoyong](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/luxiaoyong/32/24592_2.png) [@luxiaoyong](https://forum.djangoproject.com/u/luxiaoyong)\
**Post date:** [February 14, 2025, 5:55am UTC](https://forum.djangoproject.com/t/django-4-2-16-daphne-4-1-2-http-requests-timeout-result-main-thread-deadlock/38835/1 "2025-02-14T05:55:22Z")

</div>

The old version used WSGI for HTTP requests, but after upgrading to Django 4.2.16 + Daphne 4.1.2, HTTP requests now use ASGI. However, the view functions remain synchronous functions. We found that after an interface times out, it causes the main thread of Daphne to be locked. I discovered that using asynchronous view functions can resolve this issue, as there is robust timeout handling for asynchronous views. My question is: does Daphne not handle timeout scenarios for synchronous functions? Currently, all the functions in our project are implemented synchronously. Is there a better way to solve the problem of the main thread being locked?
