-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Initialize lookup-request variables locally before request-instance recycle #117
Conversation
CLA is valid! |
2 similar comments
CLA is valid! |
CLA is valid! |
@@ -151,39 +151,42 @@ protected void handleLookup(CommandLookupTopic lookup) { | |||
if (log.isDebugEnabled()) { | |||
log.debug("Received Lookup from {}", remoteAddress); | |||
} | |||
lookupDestinationAsync(getBrokerService().pulsar(), DestinationName.get(lookup.getTopic()), | |||
final long requestId = lookup.getRequestId(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting is off here
@@ -238,17 +241,18 @@ protected void handleSubscribe(final CommandSubscribe subscribe) { | |||
} else { | |||
authorizationFuture = CompletableFuture.completedFuture(true); | |||
} | |||
final String topicName = subscribe.getTopic(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting
@@ -71,7 +71,7 @@ | |||
|
|||
private final AtomicLong producerIdGenerator = new AtomicLong(); | |||
private final AtomicLong consumerIdGenerator = new AtomicLong(); | |||
protected static final AtomicLong requestIdGenerator = new AtomicLong(); | |||
protected final AtomicLong requestIdGenerator = new AtomicLong(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could be private
@@ -364,6 +364,10 @@ long newConsumerId() { | |||
long newRequestId() { | |||
return requestIdGenerator.getAndIncrement(); | |||
} | |||
|
|||
ConnectionPool getCnxPool() { | |||
return cnxPool; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting
3a20361
to
c7be724
Compare
Addressed the changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
* fixing response codes and cli * cleaning up * fixing unit tests
…est !56) Fix the system topic schema not compatible bug. (apache#117)
Motivation
As lookup (PartitionMetadata/Lookup-topic) requests being processed async: Lookup-request instance gets recycled immediately after main-io thread completes its process and triggers async-processing of request in a different thread. So, we need to copy request-variables locally for processing-thread before instance gets recycled.
Modifications
Initialize lookup-request variable locally before Lookup-request instance gets recycled.
Result
It returns lookup-response with correct response-value.