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

Handle concurrent open cursor requests #50

Merged
merged 1 commit into from
Oct 6, 2016

Conversation

sboobna
Copy link
Contributor

@sboobna sboobna commented Oct 5, 2016

Motivation

If the Managed Ledger gets concurrent open cursor requests for the same cursor, 1 request fails with Cursor already exists exception.

Modifications

Any cursor that is uninitialized will be reused for the next open cursor request using a Completable Future for the cursor, so that it doesn't try to create a new cursor.

Result

Managed Ledger will be able to handle concurrent open cursor requests properly.

@sboobna sboobna added the type/bug The PR fixed a bug or issue reported a bug label Oct 5, 2016
@yahoocla
Copy link

yahoocla commented Oct 5, 2016

CLA is valid!

1 similar comment
@yahoocla
Copy link

yahoocla commented Oct 5, 2016

CLA is valid!

Copy link
Contributor

@merlimat merlimat left a comment

Choose a reason for hiding this comment

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

👍

// Update the ack position (ignoring entries that were written while the cursor was being created)
cursor.initializeCursorPosition(getLastPositionAndCounter());

synchronized (this) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Now, as we are sure that only one thread calls cursor.initialize(..) then should we need synchronized here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But another thread will be accessing uninitializedCursors, so we will need it to be synchronized

@rdhabalia rdhabalia added this to the 1.15 milestone Oct 6, 2016
@merlimat merlimat merged commit f526016 into apache:master Oct 6, 2016
sijie added a commit to sijie/pulsar that referenced this pull request Mar 4, 2018
massakam pushed a commit to massakam/pulsar that referenced this pull request Aug 6, 2020
Change first release version to 1.0.0
hrsakai pushed a commit to hrsakai/pulsar that referenced this pull request Dec 10, 2020
Fixes apache#49

Motivation
By default, timeout exit after 10 minutes

go test --help
-timeout d
        If a test binary runs longer than duration d, panic.
        If d is 0, the timeout is disabled.
        The default is 10 minutes (10m).
hangc0276 pushed a commit to hangc0276/pulsar that referenced this pull request May 26, 2021
…opicx (apache#50)

In PR apache#47,  there is a change to return kafka client with pulsar format topic, This is a change mainly to revert the return of topic name from `persistent://tent/ns/topicx` back to `topicx`.
Also added a unit-test for this.

Some minor changes, besides this main change:
- fix log level when parse listeners port.
- change default log4j2 log level from debug to info.
- fix assert from ledgeId > 0 to ledgerId >= 0.
- add a test for message order.

========

* fix log level for listeners port get

* change default log level in log4j2

* fix assert from ledgeId > 0 to ledgerId >= 0

* add a test to check message order

* revert the return of topic name from persistent://tent/ns/topicx to topicx

* add test for metadata request handling

* fix checkstyle

* mv utils from request handler to file TopicNameUtils
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants