﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
23721	[PATCH] Application hangs indefinitely if Bing API unavailable	openstreetmap.a9ust@…	team	"==== What steps will reproduce the problem?
1. Try to import Bing imagery
2. Watch the program hang indefinitely and have to kill it with a process manager

==== What is the expected result?
If Bing API is unavailable the app shouldn't crash

==== What happens instead?
The whole time while it's waiting for Bing, the app is unresponsive. This is an issue when the retry timeout doubles each time.

==== Please provide any additional information below. Attach a screenshot if possible.

{{{
2024-06-08 11:27:28.805 WARNING: Could not connect to Bing API. Will retry in 64 seconds.: java.net.SocketTimeoutException: Connect timed out
2024-06-08 11:28:47.877 INFO: GET https://dev.virtualearth.net/REST/v1/Imagery/Metadata/AerialOSM?include=ImageryProviders&output=xml&key=...stripped... -> !!! (15.1 s)
2024-06-08 11:28:47.877 WARNING: java.net.SocketTimeoutException: Connect timed out
java.net.SocketTimeoutException: Connect timed out
	at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:546)
	at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:592)
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
	at java.base/java.net.Socket.connect(Socket.java:751)
	at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:304)
	at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:178)
	at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:531)
	at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:636)
	at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)
	at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:377)
	at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1237)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1123)
	at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179)
	at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:141)
	at org.openstreetmap.josm.tools.Http1Client.performConnection(Http1Client.java:78)
	at org.openstreetmap.josm.tools.HttpClient.connect(HttpClient.java:162)
	at org.openstreetmap.josm.tools.HttpClient.connect(HttpClient.java:136)
	at org.openstreetmap.josm.tools.HttpClient.connect(HttpClient.java:125)
	at org.openstreetmap.josm.data.imagery.CachedAttributionBingAerialTileSource$BingAttributionData.updateData(CachedAttributionBingAerialTileSource.java:65)
	at org.openstreetmap.josm.io.CacheCustomContent.updateForce(CacheCustomContent.java:131)
	at org.openstreetmap.josm.io.CacheCustomContent.updateForceString(CacheCustomContent.java:143)
	at org.openstreetmap.josm.io.CacheCustomContent.updateIfRequiredString(CacheCustomContent.java:121)
	at org.openstreetmap.josm.data.imagery.CachedAttributionBingAerialTileSource.lambda$getAttributionLoaderCallable$0(CachedAttributionBingAerialTileSource.java:88)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at java.base/java.lang.Thread.run(Thread.java:1583)

2024-06-08 11:28:47.878 WARNING: Already here java.net.SocketTimeoutException: Connect timed out
2024-06-08 11:28:47.878 WARNING: Could not connect to Bing API. Will retry in 128 seconds.: java.net.SocketTimeoutException: Connect timed out
}}}



{{{
Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2024-06-03 18:08:14 +0200 (Mon, 03 Jun 2024)
Revision:19096
Build-Date:2024-06-04 01:31:15
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (19096 en_GB) Linux Freedesktop SDK 23.08 (Flatpak runtime)
Memory Usage: 252 MB / 8008 MB (144 MB allocated, but free)
Java version: 21.0.3+2, Flathub, OpenJDK 64-Bit Server VM
Look and Feel: javax.swing.plaf.metal.MetalLookAndFeel
Screen: :0.0 1920×1080 (scaling 1.00×1.00) :0.1 1920×1080 (scaling 1.00×1.00)
Maximum Screen Size: 1920×1080
Best cursor sizes: 16×16→16×16, 32×32→32×32
Environment variable LANG: en_GB.UTF-8
System property file.encoding: UTF-8
System property sun.jnu.encoding: UTF-8
Locale info: en_GB
Numbers with default locale: 1234567890 -> 1234567890
Desktop environment: GNOME
VM arguments: [--module-path=/app/share/openjfx/lib, --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web, -Djosm.restart=true, -Djava.net.useSystemProxies=true, --add-exports=java.base/sun.security.action=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED]

Plugins:
+ BuildingGeneralization (36)
+ ImageWayPoint (36226)
+ ImproveWay (32)
+ OpeningHoursEditor (36258)
+ buildings_tools (36226)
+ centernode (v1.0.4)
+ indoorequal (0.0.7)
+ indoorhelper (1.2.3)
+ terracer (36205)
+ wikipedia (605)

Map paint styles:
+ <josm.userdata>/plugins/indoorhelper/resources/sit.mapcss
}}}
"	defect	closed	normal	24.07	Core imagery		fixed	template_report	
