Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-3145

Windows: Repeatedly calling no-op functions with asyncio.to_thread() causes warning spam in console

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 6.9.0, 6.9.1, 6.8.3
    • QtAsyncio
    • None
    • Python 3.12.8
      Windows 11 Pro 24H2
    • Windows

      Repeatedly calling a no-op* function using asyncio.to_thread() in a QtAsyncio event loop causes the following warning to be repeatedly spammed to the console:

      QEventDispatcherWin32::wakeUp: Failed to post a message (Not enough quota is available to process this command.)

      MWE to reproduce the issue:

      import asyncio
      
      from PySide6 import QtAsyncio
      
      
      def no_op(): ...
      
      
      async def my_coroutine():
          while True:
              await asyncio.to_thread(no_op)
      
      
      if __name__ == "__main__":
          QtAsyncio.run(my_coroutine())
      

      * or very short - if no_op() is defined as:

      def no_op():
          time.sleep(0.001)
      

      the issue will still occur after ~20s

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            crmaurei Cristian Maureira-Fredes
            tacd David Buxton
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes