You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2023/01/17 10:26:11 UTC
[GitHub] [pulsar] nodece opened a new pull request, #19256: [fix][websocket] Fix webSocketPingDurationSeconds config
nodece opened a new pull request, #19256:
URL: https://github.com/apache/pulsar/pull/19256
### Motivation
#19203 introduces `webSocketPingDurationSeconds` config, but didn't add this config to the proxy and broker config class.
### Modifications
- Add `webSocketPingDurationSeconds` to `ProxyConfiguration`
- Add `webSocketPingDurationSeconds` to `ServiceConfiguration`
- Improve reading the `webSocketPingDurationSeconds`
### Documentation
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `doc` <!-- Your PR contains doc changes. Please attach the local preview screenshots (run `sh start.sh` at `pulsar/site2/website`) to your PR description, or else your PR might not get merged. -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
### Matching PR in forked repository
PR in forked repository: <!-- ENTER URL HERE -->
<!--
After opening this PR, the build in apache/pulsar will fail and instructions will
be provided for opening a PR in the PR author's forked repository.
apache/pulsar pull requests should be first tested in your own fork since the
apache/pulsar CI based on GitHub Actions has constrained resources and quota.
GitHub Actions provides separate quota for pull requests that are executed in
a forked repository.
The tests will be run in the forked repository until all PR review comments have
been handled, the tests pass and the PR is approved by a reviewer.
-->
--
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
[GitHub] [pulsar] codelipenghui commented on a diff in pull request #19256: [fix][websocket] Fix webSocketPingDurationSeconds config
Posted by GitBox <gi...@apache.org>.
codelipenghui commented on code in PR #19256:
URL: https://github.com/apache/pulsar/pull/19256#discussion_r1073509207
##########
pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConfiguration.java:
##########
@@ -803,6 +803,12 @@ public class ProxyConfiguration implements PulsarConfiguration {
)
private boolean webSocketServiceEnabled = false;
+ @FieldContext(
+ category = CATEGORY_WEBSOCKET,
+ doc = "Interval of time to sending the ping to keep alive in WebSocket proxy. "
+ + "This value greater than 0 means enabled")
+ private int webSocketPingDurationSeconds = -1;
Review Comment:
It is better to use `webSocketKeepAliveIntervalSeconds` to make it consistent with the existing name `keepAliveIntervalSeconds`
And we should also add `keepAliveIntervalSeconds` to `websocket.conf`
--
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
[GitHub] [pulsar] Technoboy- commented on a diff in pull request #19256: [fix][websocket] Fix webSocketPingDurationSeconds config
Posted by GitBox <gi...@apache.org>.
Technoboy- commented on code in PR #19256:
URL: https://github.com/apache/pulsar/pull/19256#discussion_r1082044135
##########
pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConfiguration.java:
##########
@@ -803,6 +803,12 @@ public class ProxyConfiguration implements PulsarConfiguration {
)
private boolean webSocketServiceEnabled = false;
+ @FieldContext(
+ category = CATEGORY_WEBSOCKET,
+ doc = "Interval of time to sending the ping to keep alive in WebSocket proxy. "
+ + "This value greater than 0 means enabled")
+ private int webSocketPingDurationSeconds = -1;
Review Comment:
ok
--
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
[GitHub] [pulsar] nodece commented on pull request #19256: [fix][websocket] Fix webSocketPingDurationSeconds config
Posted by GitBox <gi...@apache.org>.
nodece commented on PR #19256:
URL: https://github.com/apache/pulsar/pull/19256#issuecomment-1386720496
Ping @poorbarcode
--
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
[GitHub] [pulsar] nodece commented on pull request #19256: [fix][websocket] Fix webSocketPingDurationSeconds config
Posted by GitBox <gi...@apache.org>.
nodece commented on PR #19256:
URL: https://github.com/apache/pulsar/pull/19256#issuecomment-1397152986
branch-2.10 and branch-2.11 include these changes.
--
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
[GitHub] [pulsar] nodece merged pull request #19256: [fix][websocket] Fix webSocketPingDurationSeconds config
Posted by GitBox <gi...@apache.org>.
nodece merged PR #19256:
URL: https://github.com/apache/pulsar/pull/19256
--
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
[GitHub] [pulsar] codecov-commenter commented on pull request #19256: [fix][websocket] Fix webSocketPingDurationSeconds config
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #19256:
URL: https://github.com/apache/pulsar/pull/19256#issuecomment-1386662028
# [Codecov](https://codecov.io/gh/apache/pulsar/pull/19256?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#19256](https://codecov.io/gh/apache/pulsar/pull/19256?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f3d8640) into [master](https://codecov.io/gh/apache/pulsar/commit/334c3a541f00c08aa2f378a6cc45f37cbeb54a5c?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (334c3a5) will **decrease** coverage by `14.53%`.
> The diff coverage is `3.76%`.
[](https://codecov.io/gh/apache/pulsar/pull/19256?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #19256 +/- ##
=============================================
- Coverage 47.04% 32.51% -14.53%
- Complexity 9190 13218 +4028
=============================================
Files 607 1575 +968
Lines 57677 123873 +66196
Branches 6007 13483 +7476
=============================================
+ Hits 27132 40277 +13145
- Misses 27598 78972 +51374
- Partials 2947 4624 +1677
```
| Flag | Coverage Δ | |
|---|---|---|
| inttests | `17.96% <1.61%> (?)` | |
| unittests | `48.06% <2.97%> (+1.02%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/pulsar/pull/19256?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...rg/apache/pulsar/broker/delayed/bucket/Bucket.java](https://codecov.io/gh/apache/pulsar/pull/19256?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9kZWxheWVkL2J1Y2tldC9CdWNrZXQuamF2YQ==) | `0.00% <0.00%> (ø)` | |
| [...r/delayed/bucket/BucketDelayedDeliveryTracker.java](https://codecov.io/gh/apache/pulsar/pull/19256?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9kZWxheWVkL2J1Y2tldC9CdWNrZXREZWxheWVkRGVsaXZlcnlUcmFja2VyLmphdmE=) | `0.00% <0.00%> (ø)` | |
| [...layed/bucket/CombinedSegmentDelayedIndexQueue.java](https://codecov.io/gh/apache/pulsar/pull/19256?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9kZWxheWVkL2J1Y2tldC9Db21iaW5lZFNlZ21lbnREZWxheWVkSW5kZXhRdWV1ZS5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...ulsar/broker/delayed/bucket/DelayedIndexQueue.java](https://codecov.io/gh/apache/pulsar/pull/19256?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9kZWxheWVkL2J1Y2tldC9EZWxheWVkSW5kZXhRdWV1ZS5qYXZh) | `0.00% <0.00%> (ø)` | |
| [.../pulsar/broker/delayed/bucket/ImmutableBucket.java](https://codecov.io/gh/apache/pulsar/pull/19256?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9kZWxheWVkL2J1Y2tldC9JbW11dGFibGVCdWNrZXQuamF2YQ==) | `0.00% <0.00%> (ø)` | |
| [...he/pulsar/broker/delayed/bucket/MutableBucket.java](https://codecov.io/gh/apache/pulsar/pull/19256?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9kZWxheWVkL2J1Y2tldC9NdXRhYmxlQnVja2V0LmphdmE=) | `0.00% <0.00%> (ø)` | |
| [...ed/bucket/TripleLongPriorityDelayedIndexQueue.java](https://codecov.io/gh/apache/pulsar/pull/19256?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9kZWxheWVkL2J1Y2tldC9UcmlwbGVMb25nUHJpb3JpdHlEZWxheWVkSW5kZXhRdWV1ZS5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...er/service/persistent/GeoPersistentReplicator.java](https://codecov.io/gh/apache/pulsar/pull/19256?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zZXJ2aWNlL3BlcnNpc3RlbnQvR2VvUGVyc2lzdGVudFJlcGxpY2F0b3IuamF2YQ==) | `4.00% <0.00%> (ø)` | |
| [...ar/broker/service/persistent/ShadowReplicator.java](https://codecov.io/gh/apache/pulsar/pull/19256?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zZXJ2aWNlL3BlcnNpc3RlbnQvU2hhZG93UmVwbGljYXRvci5qYXZh) | `12.00% <0.00%> (-0.25%)` | :arrow_down: |
| [...che/pulsar/websocket/AbstractWebSocketHandler.java](https://codecov.io/gh/apache/pulsar/pull/19256?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLXdlYnNvY2tldC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL3dlYnNvY2tldC9BYnN0cmFjdFdlYlNvY2tldEhhbmRsZXIuamF2YQ==) | `0.00% <0.00%> (ø)` | |
| ... and [1055 more](https://codecov.io/gh/apache/pulsar/pull/19256?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
--
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
[GitHub] [pulsar] nodece commented on pull request #19256: [fix][websocket] Fix webSocketPingDurationSeconds config
Posted by GitBox <gi...@apache.org>.
nodece commented on PR #19256:
URL: https://github.com/apache/pulsar/pull/19256#issuecomment-1386518536
/pulsarbot rerun-failure-checks
--
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
[GitHub] [pulsar] poorbarcode commented on a diff in pull request #19256: [fix][websocket] Fix webSocketPingDurationSeconds config
Posted by GitBox <gi...@apache.org>.
poorbarcode commented on code in PR #19256:
URL: https://github.com/apache/pulsar/pull/19256#discussion_r1082050185
##########
pulsar-websocket/src/main/java/org/apache/pulsar/websocket/AbstractWebSocketHandler.java:
##########
@@ -192,18 +191,15 @@ private void closePingFuture() {
@Override
public void onWebSocketConnect(Session session) {
super.onWebSocketConnect(session);
- WebSocketProxyConfiguration webSocketProxyConfig = service.getWebSocketProxyConfig();
- if (webSocketProxyConfig != null) {
- int webSocketPingDurationSeconds = webSocketProxyConfig.getWebSocketPingDurationSeconds();
Review Comment:
> No. My changes don't break the tests of https://github.com/apache/pulsar/pull/19203.
Ah, yes. you are right. The configuration that acts on `WebSocketProxyConfiguration` is copied to `ServiceConfiguration`.
--
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
[GitHub] [pulsar] nodece commented on a diff in pull request #19256: [fix][websocket] Fix webSocketPingDurationSeconds config
Posted by GitBox <gi...@apache.org>.
nodece commented on code in PR #19256:
URL: https://github.com/apache/pulsar/pull/19256#discussion_r1073613961
##########
pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConfiguration.java:
##########
@@ -803,6 +803,12 @@ public class ProxyConfiguration implements PulsarConfiguration {
)
private boolean webSocketServiceEnabled = false;
+ @FieldContext(
+ category = CATEGORY_WEBSOCKET,
+ doc = "Interval of time to sending the ping to keep alive in WebSocket proxy. "
+ + "This value greater than 0 means enabled")
+ private int webSocketPingDurationSeconds = -1;
Review Comment:
We already add this to other branches, so I don't suggest rename to `keepAliveIntervalSeconds`.
--
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
[GitHub] [pulsar] nodece commented on a diff in pull request #19256: [fix][websocket] Fix webSocketPingDurationSeconds config
Posted by GitBox <gi...@apache.org>.
nodece commented on code in PR #19256:
URL: https://github.com/apache/pulsar/pull/19256#discussion_r1081433085
##########
pulsar-websocket/src/main/java/org/apache/pulsar/websocket/AbstractWebSocketHandler.java:
##########
@@ -192,18 +191,15 @@ private void closePingFuture() {
@Override
public void onWebSocketConnect(Session session) {
super.onWebSocketConnect(session);
- WebSocketProxyConfiguration webSocketProxyConfig = service.getWebSocketProxyConfig();
- if (webSocketProxyConfig != null) {
- int webSocketPingDurationSeconds = webSocketProxyConfig.getWebSocketPingDurationSeconds();
Review Comment:
No, these configurations can be converted to each other, so add `webSocketPingDurationSeconds` to each config.
--
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
[GitHub] [pulsar] poorbarcode commented on a diff in pull request #19256: [fix][websocket] Fix webSocketPingDurationSeconds config
Posted by GitBox <gi...@apache.org>.
poorbarcode commented on code in PR #19256:
URL: https://github.com/apache/pulsar/pull/19256#discussion_r1081437289
##########
pulsar-websocket/src/main/java/org/apache/pulsar/websocket/AbstractWebSocketHandler.java:
##########
@@ -192,18 +191,15 @@ private void closePingFuture() {
@Override
public void onWebSocketConnect(Session session) {
super.onWebSocketConnect(session);
- WebSocketProxyConfiguration webSocketProxyConfig = service.getWebSocketProxyConfig();
- if (webSocketProxyConfig != null) {
- int webSocketPingDurationSeconds = webSocketProxyConfig.getWebSocketPingDurationSeconds();
Review Comment:
I see.
> Should we also should edit the test added in https://github.com/apache/pulsar/pull/19203?
And this 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
[GitHub] [pulsar] poorbarcode commented on a diff in pull request #19256: [fix][websocket] Fix webSocketPingDurationSeconds config
Posted by GitBox <gi...@apache.org>.
poorbarcode commented on code in PR #19256:
URL: https://github.com/apache/pulsar/pull/19256#discussion_r1080982888
##########
pulsar-websocket/src/main/java/org/apache/pulsar/websocket/AbstractWebSocketHandler.java:
##########
@@ -192,18 +191,15 @@ private void closePingFuture() {
@Override
public void onWebSocketConnect(Session session) {
super.onWebSocketConnect(session);
- WebSocketProxyConfiguration webSocketProxyConfig = service.getWebSocketProxyConfig();
- if (webSocketProxyConfig != null) {
- int webSocketPingDurationSeconds = webSocketProxyConfig.getWebSocketPingDurationSeconds();
Review Comment:
Does the field `webSocketPingDurationSeconds` in class `WebSocketProxyConfiguration` not useful now? If yes, should we delete it?
--
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
[GitHub] [pulsar] nodece commented on a diff in pull request #19256: [fix][websocket] Fix webSocketPingDurationSeconds config
Posted by GitBox <gi...@apache.org>.
nodece commented on code in PR #19256:
URL: https://github.com/apache/pulsar/pull/19256#discussion_r1081486686
##########
pulsar-websocket/src/main/java/org/apache/pulsar/websocket/AbstractWebSocketHandler.java:
##########
@@ -192,18 +191,15 @@ private void closePingFuture() {
@Override
public void onWebSocketConnect(Session session) {
super.onWebSocketConnect(session);
- WebSocketProxyConfiguration webSocketProxyConfig = service.getWebSocketProxyConfig();
- if (webSocketProxyConfig != null) {
- int webSocketPingDurationSeconds = webSocketProxyConfig.getWebSocketPingDurationSeconds();
Review Comment:
No. My changes don't break the tests of #19203.
--
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