Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asyncio only uses one core #40

Open
alfem opened this issue Feb 21, 2021 · 4 comments
Open

Asyncio only uses one core #40

alfem opened this issue Feb 21, 2021 · 4 comments

Comments

@alfem
Copy link
Owner

alfem commented Feb 21, 2021

Using more than one core in a Python process it not easy with asyncio.

https://stackoverflow.com/questions/57356409/python-3-asyncio-and-gil-how-to-use-all-cpu-cores-any-other-options-than-proc

So, opening as many workers as detected cores is not useful.

@Sirfrancis18
Copy link

Sirfrancis18 commented Feb 27, 2021

this Is why i have this error?
Telegram Download Daemon 1.3 Traceback (most recent call last): File "/datos/telegrams/telegram-download-daemon.py", line 216, in <module> client.loop.run_until_complete(start()) File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete return future.result() File "/datos/telegrams/telegram-download-daemon.py", line 210, in start await sendHelloMessage(client, peerChannel) File "/datos/telegrams/telegram-download-daemon.py", line 93, in sendHelloMessage await client.send_message(entity, "Telegram Download Daemon "+TDD_VERSION) File "/home/plex/.local/lib/python3.9/site-packages/telethon/client/messages.py", line 800, in send_message result = await self(request) File "/home/plex/.local/lib/python3.9/site-packages/telethon/client/users.py", line 30, in __call__ return await self._call(self._sender, request, ordered=ordered) File "/home/plex/.local/lib/python3.9/site-packages/telethon/client/users.py", line 79, in _call result = await future telethon.errors.rpcerrorlist.FloodWaitError: A wait of 521 seconds is required (caused by SendMessageRequest) [ERROR/2021-02-27 16:15:05,434]asyncio:Task was destroyed but it is pending! task: <Task pending name='Task-22' coro=<worker() running at /datos/telegrams/telegram-download-daemon.py:180> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f81c04f6280>()]>> [ERROR/2021-02-27 16:15:05,434]asyncio:Task was destroyed but it is pending! task: <Task pending name='Task-23' coro=<worker() running at /datos/telegrams/telegram-download-daemon.py:180> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f81c04f62b0>()]>> [ERROR/2021-02-27 16:15:05,434]asyncio:Task was destroyed but it is pending! task: <Task pending name='Task-24' coro=<worker() running at /datos/telegrams/telegram-download-daemon.py:180> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f81c04f6370>()]>>

@Sirfrancis18
Copy link

Sirfrancis18 commented Feb 27, 2021

I've only set it to download 1 file at a time. when I add many files at the same time (about 50) it always ends up halting in the middle and the program stops working. I have to kill him and go back inI've only set it to download 1 file at a time. when I add many files at the same time (about 50) it always ends up halting in the middle and the program stops working. I have to kill him and put on

@alfem
Copy link
Owner Author

alfem commented Feb 28, 2021

this Is why i have this error?

No, it is not related to your problem.

@Sirfrancis18
Copy link

this Is why i have this error?

No, it is not related to your problem.

Well, the downloads stop but the "list, clear, etc" commands keep working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants