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

progress output with dialog gets stuck #374

Open
ismaell opened this issue Feb 19, 2022 · 7 comments
Open

progress output with dialog gets stuck #374

ismaell opened this issue Feb 19, 2022 · 7 comments

Comments

@ismaell
Copy link
Member

ismaell commented Feb 19, 2022

Just want to add, I had problems with dialog where it would get stuck sometimes and stop updating. I think maybe it was caused by too much / too fast / repeating output same numbers from axel.

I "solved" it by piping to awk first to clean it up and only output the numbers when they actually change...

axel -p https://downloads.freepbxdistro.org/ISO/SNG7-PBX16-64bit-2202-2.iso |
awk '/^[0-9]+$/ {if($0!=last) print; fflush(); last=$0 }' |
dialog --gauge "Downloading FreePBX" 6 40

Originally posted by @luckman212 in #348 (comment)

@ismaell
Copy link
Member Author

ismaell commented Feb 24, 2022

It's not so much the repeats themselves, but that dialog is too slow updating the screen. Throttling the output might make sense.

@anindyasen
Copy link

Hi @ismaell
I am participating in hacktoberfest 2022. Can I work on this issue as a part of it. If yes, can you please explain a bit more on whats needs to be done.
Thank you,

@ismaell
Copy link
Member Author

ismaell commented Sep 29, 2022

The simplest/general solution is to throttle the output, so:

  1. find where progress reporting function is called
  2. track the time at which it is called
  3. skip call if it has been called recently (let's say, in the last 200ms, which is a quite fast pace for humans)

@anindyasen
Copy link

anindyasen commented Sep 30, 2022

Hi @ismaell
After running the latest main branch what I am observing is:
Running:

axel  https://downloads.freepbxdistro.org/ISO/SNG7-PBX16-64bit-2202-2.iso

Giving output:

axel  https://downloads.freepbxdistro.org/ISO/SNG7-PBX16-64bit-2202-2.iso
Initializing download: https://downloads.freepbxdistro.org/ISO/SNG7-PBX16-64bit-2202-2.iso
File size: 2.29688 Gigabyte(s) (2466250752 bytes)
Opening output file SNG7-PBX16-64bit-2202-2.iso.0
Starting download

[  0%] [0                     1                     2                     3                     ] [   1.2MB/s] [31:56]
[ 10%] [..0                   ..1                   ..2                   ..3                   ] [   3.9MB/s] [09:04]
[ 12%] [..0                   ..1                   ..2                   ..3                   ] [   3.9MB/s] [08:55]Connection 2 finished
Connection 0 finished
Connection 1 finished
Connection 3 finished
Connection 3 finished
Connection 0 finished
Connection 2 finished

Downloaded 2.29688 Gigabyte(s) in 9:38 minute(s). (4160.01 KB/s)

But I am not seeing the dialog getting stuck. When file was getting downloaded, I didn't observe it struck.

When I used the command with -p option
Then terminal is flooding with the below output

Opening output file SNG7-PBX16-64bit-2202-2.iso
Starting download

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Error on connection 1! Connection closed
[  0%] [0                     1                     2                     3                     ] [   1.7MB/s] [23:32]
Downloaded 8.4601 Megabyte(s) in 5 second(s). (1697.76 KB/s)

I pressed ctrl+c to stop it. This one looks like a bug. Is this what it means by progress output stuck?
Thanks.

@ismaell
Copy link
Member Author

ismaell commented Oct 3, 2022

@anindyasen it refers to the dialog program (in other words, calling: axel -p ...|dialog --gauge ...; axel produces too much output for it, often repeating the number, which is unnecessary (both the frequency of the output and repeating of the same number would, even if processed in time, lead to something the user can't see).

@anindyasen
Copy link

Hi @ismaell Thanks for the explanation. So, I am thinking to to print the percentage output only when it changes, ie. every percentage value from 1 to 100 will print only once. Will that implementation work?

Thanks

@ismaell
Copy link
Member Author

ismaell commented Oct 13, 2022

Please refer to the previous comment: #374 (comment)

It has to be time-driven instead.

@ismaell ismaell modified the milestones: v2.17.12, v2.17.13, v2.17.14 Feb 6, 2024
@ismaell ismaell modified the milestones: v2.17.14, v2.17.15 Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants