You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "codelipenghui (via GitHub)" <gi...@apache.org> on 2023/10/07 03:56:20 UTC
Re: [PR] [fix][broker] Fix starting function worker with tls error [pulsar]
codelipenghui commented on code in PR #21221:
URL: https://github.com/apache/pulsar/pull/21221#discussion_r1349455118
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java:
##########
@@ -1766,18 +1766,32 @@ private void startWorkerService(AuthenticationService authenticationService,
AuthorizationService authorizationService)
throws Exception {
if (functionWorkerService.isPresent()) {
- if (workerConfig.isUseTls() || brokerServiceUrl == null) {
+ if (isNotBlank(brokerServiceUrlTls)) {
Review Comment:
Do we also need to check `workerConfig.isUseTls()`? It has been deprecated but hasn't been removed yet. If there is an existing cluster that has `brokerServiceUrlTls` configured, but `useTls` is false. We should not use TLS in this case?
##########
tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/StandaloneContainer.java:
##########
@@ -31,29 +31,37 @@ public class StandaloneContainer extends PulsarContainer<StandaloneContainer> {
public static final String NAME = "standalone";
public StandaloneContainer(String clusterName) {
- super(clusterName,
- NAME,
- NAME + "-cluster",
- "bin/pulsar",
- BROKER_PORT,
- BROKER_HTTP_PORT);
+ this(clusterName, DEFAULT_IMAGE_NAME);
}
public StandaloneContainer(String clusterName, String pulsarImageName) {
+ this(clusterName, pulsarImageName, false);
+ }
+
+ public StandaloneContainer(String clusterName, String pulsarImageName, boolean enableTls) {
super(clusterName,
NAME,
NAME + "-cluster",
- "bin/pulsar",
+ pulsarImageName.endsWith("latest") ? "bin/run-standalone.sh" : "bin/pulsar",
Review Comment:
Why do we need to check if the image name ends with "latest"?
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java:
##########
@@ -1766,18 +1766,32 @@ private void startWorkerService(AuthenticationService authenticationService,
AuthorizationService authorizationService)
throws Exception {
if (functionWorkerService.isPresent()) {
- if (workerConfig.isUseTls() || brokerServiceUrl == null) {
+ if (isNotBlank(brokerServiceUrlTls)) {
workerConfig.setPulsarServiceUrl(brokerServiceUrlTls);
} else {
workerConfig.setPulsarServiceUrl(brokerServiceUrl);
}
- if (workerConfig.isUseTls() || webServiceAddress == null) {
+ if (isNotBlank(webServiceAddressTls)) {
Review Comment:
Same as the above comment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org