#๐ Extremely Annoying and Out Of Hand Asyncio Server Problem
92 messages ยท Page 1 of 1 (latest)
@mortal ivy
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
this looks really weird
why are you even using asyncio if you're just spawning threads anyway?
im not?
im using one thread for the server
and im not sure why
i just kept it like that after i switched to asyncio
@dire torrent HELP
please
its a huge problem
this whole architecture looks really strange...if you have services written for asyncio, you shouldn't be spawning any extra threads
which Python version are you running?
3.11
im not though
i just use it to run the server's classes
thats it
I never said that
but you don't need any threads here
is it possible that your threads are crashing silently?
but why would they you think?
all exceptions are handled
cpu is stable
memory is stable
I don't expect CPU or memory to be affected if a thread crashes
oh
at any rate, it doesn't seem like there's any point in using threads here so I'd advise you to simplify the architecture at first
hard to say at this point
why you have so many made-up dunder methods?
for?
like __close_socket__
the point of dunder methods is that they have special meaning for the interpreter
cus its for built in functions
ik
but
i just idk
its not like anyone else is supposed to see it
so i did it
ik its looks shit rn
when you get rid of the threads, you could add a "canary" task that prints something to the console every 10 seconds or so, so it the messages stop coming, you know the event loop is stuck
you could also check the status of tasks
I also can't understand this:
async def container():
await asyncio.create_task(self.__run__())
asyncio.run(container())
why do this in such a roundabout way, instead of just asyncio.run(self.__run__())?
(not that I recommend doing this in __init__() anyway)
thats what it was
thats literally what it was
but i changed it cus im so confused what the fuck is going wrong here
the event loop getting blocked is a common cause for weird things like these
hence the suggestion for the canary task
it also got stuck when i did this
it never exits the loop
ever
its not even the loop i dont think
when should it exit the event loop then?
its serve_forever
yes, hence my question
its not supposed to exit
well, does it?
no
so no problem then?
that's what you need to confirm with the canary task
my other logs
of Establishing SONY PSN CC show me when it stops working
and ive logged all exceptions in error.txt
everything
there is no thing unusual
ever
@dire torrent
there is my point
thats why i used threads
if i await the __run__, it pauses everyhting
nvm
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.
๐ Extremely Annoying and Out Of Hand Asyncio Server Problem