-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: Add timeout option (fixes #15) #16
Conversation
I agree with your approach, good call, but I'm having serious issues when trying to run this. Sorry, I really don't have much time to look at this at the moment, but I have given it a test and it has completely locked my system up (twice - requiring a forced restart). I believe there is something inherently wrong - I just don't know where exactly.
The |
Gosh, I'm sorry you'd had to have dealt with that. I tested it on both a new Windows 11 64 AMD, and a five year old Ubuntu Nobel 64 AMD, without any issues with any timeouts. The code seems pretty simple, but let me play around some more and see if I can figure out what's causing the issue. Perhaps
needs to be
and then we call |
Maybe 🤷♂️ I really don't know, and I'd love to help you debug it but I'm somewhat overloaded at the moment (work/life). |
@axllent I replaced Context with a simple NewTimer(), as that's all we really need. I tested in both Linux and Windows and it works fine. Lemme know if it works for you. If not, let's just drop it. |
@rasa I'm actually away for 3 days, so please don't think I'm ignoring you, but I'll only be able to test when I'm back next week 👍 Thanks for looking into it, looking forward to testing! |
@rasa - I've done some more testing and unfortunately it still crashes my system. I do however know now why it crashes, but just not what is causing it exactly. While running with any timeout set, the app's RAM usage increases +-1GB per second - so the machine effectively runs out of RAM. I am surprised you haven't encountered this issue though. |
Wow, that's crazy. I tested it on Ubuntu and Windows, and no memory leaks. Can you try another system, or VM? According to |
I've just tested on a completely different machine (a laptop also running Ubuntu 22.04) and it has the same issue, just a little slower (500MB/s increase, probably due to the smaller CPU / less threads). Completely different hardware (laptop / intel CPU vs desktop AMD). I don't think this is hardware related though, Go is pretty good that way. Finally, I have just tested on an Ubuntu 24 VM (running in VirtualBox) and it also has the same RAM issue, so yeah, I believe it is an issue, I'm just surprised you don't have it (are you really sure though?). I'm monitoring it using Very odd... |
Try it now. I misread your message, and only tested without a timer, which was just plain dumb in hindsight. With a timer active it leaked. With this latest fix, it doesn't. Sorry for all the extra work. |
Yes, that solves the issue, well done! I'll give this more testing in the coming day or two, but I can confirm there is no memory leak now. Thanks for finding that @rasa! |
Works perfectly @rasa - thank you for you hard work. This has been released now as 0.1.0 🥳 |
Based on your feedback, I made some assumptions:
--timeout
and-T
, not durationWe use the ParseDuration function, which allows for:
and allows for values up to 999,999 hours (114 years). This saved me time having to code a duration parser. I don't think we have to document this, though, do we?