Skip to content

Fix connection event error#1730

Merged
Technoboy- merged 3 commits intomasterfrom
fix_connection_event
Apr 30, 2025
Merged

Fix connection event error#1730
Technoboy- merged 3 commits intomasterfrom
fix_connection_event

Conversation

@coderzc
Copy link
Copy Markdown
Member

@coderzc coderzc commented Apr 29, 2025

Motivation

2025-04-29T14:35:42,091+0000 [broker-client-shared-internal-executor-5-1] ERROR io.streamnative.pulsar.handlers.mqtt.common.systemtopic.SystemTopicBasedSystemEventService - refresh cache error
java.lang.NullPointerException: null
	at java.base/java.util.concurrent.ConcurrentHashMap.putVal(Unknown Source) ~[?:?]
	at java.base/java.util.concurrent.ConcurrentHashMap.put(Unknown Source) ~[?:?]
	at io.streamnative.pulsar.handlers.mqtt.common.MQTTConnectionManager$ConnectEventListener.onChange(MQTTConnectionManager.java:129) ~[?:?]
	at io.streamnative.pulsar.handlers.mqtt.common.systemtopic.SystemTopicBasedSystemEventService.lambda$refreshCache$14(SystemTopicBasedSystemEventService.java:240) ~[?:?]
	at java.base/java.util.ArrayList.forEach(Unknown Source) ~[?:?]
	at io.streamnative.pulsar.handlers.mqtt.common.systemtopic.SystemTopicBasedSystemEventService.refreshCache(SystemTopicBasedSystemEventService.java:240) ~[?:?]
	at io.streamnative.pulsar.handlers.mqtt.common.systemtopic.SystemTopicBasedSystemEventService.lambda$readEvent$13(SystemTopicBasedSystemEventService.java:196) ~[?:?]
	at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(Unknown Source) ~[?:?]
	at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(Unknown Source) ~[?:?]
	at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source) ~[?:?]
	at java.base/java.util.concurrent.CompletableFuture.complete(Unknown Source) ~[?:?]
	at org.apache.pulsar.client.impl.ConsumerBase.lambda$completePendingReceive$0(ConsumerBase.java:330) ~[io.streamnative-pulsar-client-original-3.3.5.5.jar:3.3.5.5]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:?]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:?]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[io.netty-netty-common-4.1.119.Final.jar:4.1.119.Final]
	at java.base/java.lang.Thread.run(Unknown Source) [?:?]

Modifications

Using REMOTE_CONNECTION_SOLT instead of nll value, since ConcurrentMap can't allow null value

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Documentation

Check the box below.

Need to update docs?

  • doc-required

    (If you need help on updating docs, create a doc issue)

  • no-need-doc

    (Please explain why)

  • doc

    (If this PR contains doc changes)

@github-actions
Copy link
Copy Markdown

@coderzc:Thanks for your contribution. For this PR, do we need to update docs?
(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

@coderzc coderzc force-pushed the fix_connection_event branch from de9a6d3 to 37f03af Compare April 29, 2025 15:25
@coderzc coderzc changed the title Fix connection management Fix connection event Apr 29, 2025
@coderzc coderzc changed the title Fix connection event Fix connection event error Apr 29, 2025
@Technoboy- Technoboy- closed this Apr 30, 2025
@Technoboy- Technoboy- reopened this Apr 30, 2025
@Technoboy- Technoboy- merged commit 4584ecb into master Apr 30, 2025
50 checks passed
Technoboy- pushed a commit that referenced this pull request Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants