Skip to content

[BUG] Error occurred in DefaultStreamLoader#getAvailableHost while trying to load a URL due to configuration issues. #367

@xumanbu

Description

@xumanbu

When configuring the load URL value, I mistakenly used a comma instead of a semicolon, like this : 10.x.x.1:8030,10.x.x.2:8030,10.x.x.3:8030.

except: throw an exception while flink start failed
acture: only log error, flink application is running available

I found two point can be optimized.

  1. DefaultStreamLoader#testHttpConnection catched all Exception at now, wo can catch MalformedURLException and throw an IllegalArgumentException.
  2. StarRocksSinkOptions#validateStreamLoadUrl should be enhance.
Failed to connect to address:http://10.x.x.1:8030,10.x.x.2:8030,10.x.x.3:8030
java.net.MalformedURLException: For input string: "8030,10.x.x.2:8030,10.x.x.3:8030"
	at java.net.URL.<init>(URL.java:645) ~[?:1.8.0_262]
	at java.net.URL.<init>(URL.java:508) ~[?:1.8.0_262]
	at java.net.URL.<init>(URL.java:457) ~[?:1.8.0_262]
	at com.starrocks.data.load.stream.DefaultStreamLoader.testHttpConnection(DefaultStreamLoader.java:302) ~[flink-connector-starrocks-2.5_flink-1.15.2-vip.jar:?]
	at com.starrocks.data.load.stream.DefaultStreamLoader.getAvailableHost(DefaultStreamLoader.java:290) ~[flink-connector-starrocks-2.5_flink-1.15.2-vip.jar:?]
	at com.starrocks.data.load.stream.DefaultStreamLoader.send(DefaultStreamLoader.java:225) ~[flink-connector-starrocks-2.5_flink-1.15.2-vip.jar:?]
	at com.starrocks.data.load.stream.DefaultStreamLoader.lambda$send$2(DefaultStreamLoader.java:113) ~[flink-connector-starrocks-2.5_flink-1.15.2-vip.jar:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_262]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_262]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_262]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_262]
Caused by: java.lang.NumberFormatException: For input string: "8030,gd17-bigdata-starrocks-120-179-42.idc.vip.com:8030,gd17-bigdata-starrocks-120-204-34.idc.vip.com:8030"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:1.8.0_262]
	at java.lang.Integer.parseInt(Integer.java:580) ~[?:1.8.0_262]
	at java.lang.Integer.parseInt(Integer.java:615) ~[?:1.8.0_262]
	at java.net.URLStreamHandler.parseURL(URLStreamHandler.java:222) ~[?:1.8.0_262]
	at java.net.URL.<init>(URL.java:640) ~[?:1.8.0_262]
	... 10 more

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions