Altinn / app-localtest

Solution for testing apps locally on your own machine
8 stars 14 forks source link

Workaround for frontend-version page not working in podman v5 #105

Closed bjosttveit closed 3 months ago

bjosttveit commented 3 months ago

Description

Ever since upgrading to podman v5 I have had trouble with the "Pick frontend version" page taking forever and eventually timing out. I have waited for a couple of updates with the hope that it would resolve itself, but seeing as this is still an issue for me in podman v5.1 I have made this workaround.

The issue seems to be that when trying to connect to a port on host.docker.internal that does not have a server running it just tries to connect forever until eventually timing out after 100 seconds, throwing a TaskCanceledException which is not caught in main so the page eventually fails to load. I have not figured out why the requests don't simply fail instantly. To work around this problem I catch the TaskCanceledException, use a very low timeout for the HttpClient, and run the requests in parallel so that it only takes half a second to fail all of the other requests where a frontend server is not running.

If someone else uses podman v5 and don't have this issue then maybe its just my machine, and if we figure it out we could close this.

Related Issue(s)

Verification

Documentation

bjosttveit commented 3 months ago

Seems like Ronny does not have this problem in Podman 5.0.2, so I will close this for now