Skip to content

[pulsar-admin] add read-timeout to blocked admin-request - #4484

Merged
nkurihar merged 2 commits into
apache:masterfrom
rdhabalia:tp_dead
Jun 13, 2019
Merged

[pulsar-admin] add read-timeout to blocked admin-request#4484
nkurihar merged 2 commits into
apache:masterfrom
rdhabalia:tp_dead

Conversation

@rdhabalia

Copy link
Copy Markdown
Contributor

Motivation

It fixes #4447 and unblocks broker's admin thread and avoids possible deadlock.

@rdhabalia

Copy link
Copy Markdown
Contributor Author

rerun java8 tests

this.worker = new WorkerImpl(root, auth);
this.schemas = new SchemasImpl(root, auth);
this.bookies = new BookiesImpl(root, auth);
long readTimeoutMs = readTimeoutUnit.toMillis(this.readTimeout);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I haven't found the line which sets readTimeout in https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java , so readTimeout seems to be set to the default value (60 seconds) for Brokers.

public static final int DEFAULT_READ_TIMEOUT_SECONDS = 60;

Can you make it configurable in broker.conf?
(I feel 60 seconds is too large for Brokers)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sure, I will fix it.

@sijie sijie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I see some places are using connectTimeoutMs and some places are using readTimeoutMs. Can we be consistent across all the places?

@sijie

sijie commented Jun 11, 2019

Copy link
Copy Markdown
Member

ping @rdhabalia

@rdhabalia

Copy link
Copy Markdown
Contributor Author

@nkurihar most of the admin-sync call makes blocking zk call so, configured admin-readtimeout as zkOperationTimeout. Please let me know if we have different thought on it.

@sijie

I see some places are using connectTimeoutMs and some places are using readTimeoutMs. Can we be consistent across all the places?

yes, I have fixed it.

@rdhabalia

Copy link
Copy Markdown
Contributor Author

rerun java8 tests

@nkurihar

nkurihar commented Jun 12, 2019

Copy link
Copy Markdown
Contributor

@rdhabalia
Thank you for making readTimeout configurable!

minor comment:
How about adding a comment to zooKeeperOperationTimeoutSeconds in broker.conf to explain that this value is also used as an admin-readtimeout in Brokers?

pulsar/conf/broker.conf

Lines 64 to 65 in a195221

# ZooKeeper operation timeout in seconds
zooKeeperOperationTimeoutSeconds=30

@nkurihar

Copy link
Copy Markdown
Contributor

rerun java8 tests

@codelipenghui

Copy link
Copy Markdown
Contributor

@rdhabalia do we need this issue for 2.4.0? or can we move it to 2.5.0?

@rdhabalia

Copy link
Copy Markdown
Contributor Author

yes, it's ready to merge.

@codelipenghui

Copy link
Copy Markdown
Contributor

@sijie Please help review again.

@sijie

sijie commented Jun 13, 2019

Copy link
Copy Markdown
Member

@nkurihar can you review and merge it?

@nkurihar nkurihar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

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.

Broker gets stuck when getting partitioned stats

4 participants