Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Websocket] Websocket doesn't set the correct cluster data #6102

Merged
merged 4 commits into from
Jan 24, 2020

Conversation

sijie
Copy link
Member

@sijie sijie commented Jan 21, 2020

Motivation

Fixes #5997
Fixes #6079

A regression was introduced in #5486. If websocket service as running as part of
pulsar standalone, the cluster data is set with null service urls. This causes
service url is not set correctly in the pulsar client and an illegal argument exception
("Param serviceUrl must not be blank.") will be thrown.

Modifications

  1. Pass null when constructing the websocket service. So the local cluster data can
    be refreshed when creating pulsar client.
  2. Set the cluster data after both broker service and web service started and ports are allocated.

Test

Verified locally and need to figure out how to automate this in integration tests

*Motivation*

 apache#5400 introduces `customRuntimeOptions` in function details. But the description
 was wrong. The mistake was probably introduced by bad merges.

*Modification*

Fix the argument and description for `deadletterTopic` and `customRuntimeOptions`.

*Tests*

Add a unit test to ensure the parameters are set correctly.
*Motivation*

A regression was introduced in apache#5486. If websocket service as running as part of
pulsar standalone, the cluster data is set with null service urls. This causes
service url is not set correctly in the pulsar client and an illegal argument exception
("Param serviceUrl must not be blank.") will be thrown.

*Modifications*

1. Pass `null` when constructing the websocket service. So the local cluster data can
   be refreshed when creating pulsar client.
2. Set the cluster data after both broker service and web service started and ports are allocated.

*Test*

Verified locally and need to figure out how to automate this in integration tests
@sijie sijie added type/bug The PR fixed a bug or issue reported a bug area/websocket labels Jan 21, 2020
@sijie sijie added this to the 2.5.1 milestone Jan 21, 2020
@sijie sijie self-assigned this Jan 21, 2020
Copy link
Member

@tuteng tuteng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -466,6 +464,10 @@ public Boolean get() {
this.brokerServiceUrl = brokerUrl(config);
this.brokerServiceUrlTls = brokerUrlTls(config);

ClusterData clusterData =
new ClusterData(webServiceAddress, webServiceAddressTls, brokerServiceUrl, brokerServiceUrlTls);
this.webSocketService.setLocalCluster(clusterData);
Copy link
Member

@tuteng tuteng Jan 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable this.webSocketService may not have been properly initialized?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@jiazhai
Copy link
Member

jiazhai commented Jan 22, 2020

retest this please

@sijie sijie modified the milestones: 2.5.1, 2.6.0 Jan 22, 2020
@codelipenghui
Copy link
Contributor

run java8 tests

@sijie sijie merged commit 49a9897 into apache:master Jan 24, 2020
@sijie sijie deleted the fix_websocket_regressino branch January 24, 2020 07:02
tuteng pushed a commit to AmateurEvents/pulsar that referenced this pull request Feb 23, 2020
)

*Motivation*

Fixes apache#5997
Fixes apache#6079

A regression was introduced in apache#5486. If websocket service as running as part of
pulsar standalone, the cluster data is set with null service urls. This causes
service url is not set correctly in the pulsar client and an illegal argument exception
("Param serviceUrl must not be blank.") will be thrown.

*Modifications*

1. Pass `null` when constructing the websocket service. So the local cluster data can
   be refreshed when creating pulsar client.
2. Set the cluster data after both broker service and web service started and ports are allocated.
tuteng pushed a commit to AmateurEvents/pulsar that referenced this pull request Mar 21, 2020
)

*Motivation*

Fixes apache#5997
Fixes apache#6079

A regression was introduced in apache#5486. If websocket service as running as part of
pulsar standalone, the cluster data is set with null service urls. This causes
service url is not set correctly in the pulsar client and an illegal argument exception
("Param serviceUrl must not be blank.") will be thrown.

*Modifications*

1. Pass `null` when constructing the websocket service. So the local cluster data can
   be refreshed when creating pulsar client.
2. Set the cluster data after both broker service and web service started and ports are allocated.

(cherry picked from commit 49a9897)
tuteng pushed a commit that referenced this pull request Apr 13, 2020
*Motivation*

Fixes #5997
Fixes #6079

A regression was introduced in #5486. If websocket service as running as part of
pulsar standalone, the cluster data is set with null service urls. This causes
service url is not set correctly in the pulsar client and an illegal argument exception
("Param serviceUrl must not be blank.") will be thrown.

*Modifications*

1. Pass `null` when constructing the websocket service. So the local cluster data can
   be refreshed when creating pulsar client.
2. Set the cluster data after both broker service and web service started and ports are allocated.

(cherry picked from commit 49a9897)
jiazhai pushed a commit to jiazhai/pulsar that referenced this pull request May 18, 2020
)

*Motivation*

Fixes apache#5997
Fixes apache#6079

A regression was introduced in apache#5486. If websocket service as running as part of
pulsar standalone, the cluster data is set with null service urls. This causes
service url is not set correctly in the pulsar client and an illegal argument exception
("Param serviceUrl must not be blank.") will be thrown.

*Modifications*

1. Pass `null` when constructing the websocket service. So the local cluster data can
   be refreshed when creating pulsar client.
2. Set the cluster data after both broker service and web service started and ports are allocated.
(cherry picked from commit 49a9897)
huangdx0726 pushed a commit to huangdx0726/pulsar that referenced this pull request Aug 24, 2020
)

*Motivation*

Fixes apache#5997
Fixes apache#6079

A regression was introduced in apache#5486. If websocket service as running as part of
pulsar standalone, the cluster data is set with null service urls. This causes
service url is not set correctly in the pulsar client and an illegal argument exception
("Param serviceUrl must not be blank.") will be thrown.

*Modifications*

1. Pass `null` when constructing the websocket service. So the local cluster data can
   be refreshed when creating pulsar client.
2. Set the cluster data after both broker service and web service started and ports are allocated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/websocket release/2.5.1 type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
4 participants