New submission from Carlton Gibson <carlton.gib...@noumenal.es>:

6ea29c5e90dde6c240bd8e0815614b52ac307ea1 for 
https://bugs.python.org/issue34687

"Make asynico use ProactorEventLoop by default"

This introducesd a regression in asgiref, and hence Django 3.0.x. 


https://github.com/django/asgiref/issues/132
https://code.djangoproject.com/ticket/30900


The error from the asgiref issue is clearest: 

```
asgiref\sync.py:97: in __call__
    loop_future.result()
..\..\..\AppData\Local\Programs\Python\Python38\lib\concurrent\futures\_base.py:432:
 in result
    return self.__get_result()
..\..\..\AppData\Local\Programs\Python\Python38\lib\concurrent\futures\_base.py:388:
 in __get_result
    raise self._exception
..\..\..\AppData\Local\Programs\Python\Python38\lib\concurrent\futures\thread.py:57:
 in run
    result = self.fn(*self.args, **self.kwargs)
asgiref\sync.py:130: in _run_event_loop
    loop.close()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  

self = <ProactorEventLoop running=False closed=False debug=False>

    def close(self):
        if self.is_running():
            raise RuntimeError("Cannot close a running event loop")
        if self.is_closed():
            return
    
>       signal.set_wakeup_fd(-1)
E       ValueError: set_wakeup_fd only works in main thread
```

Off the main thread, we use a ThreadPoolExecutor and wait for the future to 
finish. 

It looks as if `ProactorEventLoop` needs to check the current thread before 
triggering the signal in close().

----------
components: asyncio
messages: 355214
nosy: asvetlov, carltongibson, yselivanov
priority: normal
severity: normal
status: open
title: Asyncio regression on Windows with Python 3.8
type: crash
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38563>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to