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

Find out why ASF has CPU infinite loop on terminal detach #3051

Closed
7 tasks done
JustArchi opened this issue Oct 21, 2023 · 2 comments
Closed
7 tasks done

Find out why ASF has CPU infinite loop on terminal detach #3051

JustArchi opened this issue Oct 21, 2023 · 2 comments
Labels
🐛 Bug Issues marked with this label indicate unintended program behaviour that needs correction. ✔️ Confirmed Issues marked with this label were acknowledged and confirmed by the developers. 🟢 Low priority Issues marked with this label are actively being worked on if nothing serious is on the list.

Comments

@JustArchi
Copy link
Member

Checklist

ASF version

Latest stable release

ASF variant

linux-x64

Bug description

Issue #3050 highlighted a problem where background ASF process on Linux after restart and detaching console runs into 100% CPU utilization. I've reproduced it myself so the issue seems global enough.

Expected behavior

ASF should run in the background normally.

Actual behavior

There is a thread taking 100% CPU allocation, we should find out if it's anything related to us we can fix, or whether this is .NET issue.

Steps to reproduce

  • Start ASF in Linux terminal as usual
  • Type c to enter command mode and use restart command
  • Observe old ASF shutting down and new ASF being launched, which is no longer attached to the console (but still printing to it)
  • Close terminal
  • ASF process in the background is now using 100% CPU, best part is it seems to work correctly

Possible reason/solution

No response

Can you help us with this bug report?

Yes, I can code the solution myself and send a pull request

Full log.txt recorded during reproducing the problem

Not relevant

Global ASF.json config file

No response

BotName.json config of all affected bot instances

No response

Additional info

No response

@JustArchi JustArchi added 🐛 Bug Issues marked with this label indicate unintended program behaviour that needs correction. ✔️ Confirmed Issues marked with this label were acknowledged and confirmed by the developers. 💢 No solution yet Issues marked with this label indicate that we don't have any idea how to solve this problem yet. 🟢 Low priority Issues marked with this label are actively being worked on if nothing serious is on the list. labels Oct 21, 2023
@JustArchi JustArchi removed the 💢 No solution yet Issues marked with this label indicate that we don't have any idea how to solve this problem yet. label Oct 21, 2023
@JustArchi
Copy link
Member Author

After investigation: Linux terminal for some unknown to me reason sends 0 all the time as console input, this causes our interactive console listener to go into loop, because it now has work of reading 0 input infinitely. ASF logic works correctly, but why the hell something like that happens is unknown to me as of now, will need to code some workaround for that.

@JustArchi
Copy link
Member Author

@andreldmonteiro I've found the root culprit and managed to code a workaround for that, big thanks for report! This should no longer happen starting from ASF V5.4.12.6.

@JustArchi JustArchi mentioned this issue Nov 19, 2023
7 tasks
JustArchi added a commit that referenced this issue Nov 19, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 Bug Issues marked with this label indicate unintended program behaviour that needs correction. ✔️ Confirmed Issues marked with this label were acknowledged and confirmed by the developers. 🟢 Low priority Issues marked with this label are actively being worked on if nothing serious is on the list.
Projects
None yet
Development

No branches or pull requests

1 participant