ponyup
ponyup copied to clipboard
"show" command timeout doesn't work
Currently "ponyup show ponyc" blocks if ponyc is not already installed. As an user, I was expecting it to return the channel versions available. It only stops blocking after downloading some version of application, would be nice if it listed all version channels available for application (before downloading) instead.
To reproduce blocking behavior, try deleting the ~/.local/shared/ponyup/ folder.
@superherointj I'm unable to reproduce this.
It does what I would expect. It exits after displaying nothing.
Right. I'll close this.
@superherointj rather than closing, I'd rather investigate why it hangs for you. Perhaps I misunderstand "blocks". I assume you mean that it hangs and never returns a result, is that not what you meant?
I've made several attempts here some failed some succeed. My current hypothesis is a network problem to reach some ponyup server. But it did not return anything it would just block and never return a result, the application would not return to bash prompt. And I kept wondering what was happening. My internet is normal ponyup service/server is the exception.
Currently I can still reproduce the blocking behavior, as long as I try several times the command "ponyup show ponyc". No feedback is given to user on failure.
Once I saw: "error: server unreachable, please try again later" but I am not able to repeat this error now because I'm not sure if it happened with same comand above, probably happened with a different command.
I don't believe show
makes a network connection. AFAIK, it only checks the local .lock
file. @Theodus can you confirm that?
I would be incorrect, by default, it does indeed make a network call.
@Theodus The documentation is "The ponyup show command will display the installed package versions" which says to me that it shouldn't need to make a network call. It appears there is some confusion between what the code is doing and the documentation.
Can you clarify what is going on?
"netstat -ctp" connection log when blocking:
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 1 x220-arch:54408 server-99-84-27-2:https FIN_WAIT1 2593/ponyup
x220-arch is my hostname. And then it waits forever.
@superherointj does it time out after about 5 seconds?
I see no output in console or any timeout. On netstat, it says the connection is FIN_WAIT1. The application never ends execution and is blocked forever (it seems).
A user on stack overflow said: FIN_WAIT1 => The application on local machine has closed the connection. Indication of this has been sent to the remote machine.
Suggested reference: https://www.freesoft.org/CIE/Course/Section4/11.htm
There's a timeout of 5 seconds on the network call, so that isn't working correctly.
It makes a network call to mark packages that are not the latest versions. "If a more recent version is not installed, then the more recent version will be shown in yellow following the selected version."
Alright, so I'm going to change this to "timeout doesn't work".
I have the same behaviour as @superherointj on linux. ponyup show
is hang for 2min10s before timing out on my computer. Here is strace
output when it is blocked in case it helps:
$ sudo strace -p 26447
strace: Process 26447 attached
futex(0x7f902ad4ef60, FUTEX_WAIT_PRIVATE, 1, NULL) = 0
munmap(0x7f902a54c000, 8400896) = 0
munmap(0x7f9021d49000, 8400896) = 0
ioctl(0, SNDCTL_TMR_CONTINUE or TCSETSF, {B38400 opost isig icanon echo ...}) = 0
exit_group(0) = ?
+++ exited with 0 +++
And the problem is not limited to the show
command:
$ time ponyup update corral release
updating corral-release-latest-x86_64-linux
syncing updates from https://api.cloudsmith.io/packages/ponylang/releases/
pulling corral-release-0.5.4-x86_64-linux
|██████████████████████████████████████████████████| corral-release-0.5.4-x86_64-linux.tar.gz
selecting corral-release-0.5.4-x86_64-linux as default for corral
bin: /home/pierre/.local/share/ponyup/corral-release-0.5.4-x86_64-linux/bin/corral
link: /home/pierre/.local/share/ponyup/bin/corral
real 2m9,497s
user 0m0,042s
sys 0m0,000s
From what I've briefly looked at the source, the timeout seems to be set only for the show
command. Writing down to the link
line takes less than 1 second but then it hangs. Seems more like client and server are not closing correctly the TCP session like @superherointj pointed out.
This was discussed in the sync call.
Sean says there are two issues with this probably:
:one: it seems the timeouts are not being set correctly in all cases - this should be easier to fix
:two: a much more subtle/rare bug in some user's network setup, which is going to be harder to reproduce and fix.
@redvers has seen this before on his machine with buggy IPv6 from his ISP. He is going to reproduce and see if he can help.
I confirm the problem with IPv6. My ISP decided to stop providing IPv6 over IPv4 for the type of modem I have last year, but my modem kept a IPv6 address without me noticing. I think that situation created that the IPv6 request failed with timeout before the stack sent a new request with IPv4.
Now everything's fine for me and ponyup show ponyc
answers in 1 s.