-
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
[PIP-149] Making the REST Admin API fully async #14365
Comments
@codelipenghui @lhotari @eolivelli @BewareMyPower @nodece @mattisonchao |
Thank you @Technoboy- . Good work. I shared my thoughts and some expectations in yesterdays Pulsar Community meeting, you can find the discussion and @merlimat's responses of the rationale for the changes. It would be good to document the arguments that Matteo explained why mixing async and blocking (sync) causes issues. While digging into the Jetty settings in Pulsar, I noticed a few gaps in backpressure handling, which are relevant when there are more requests which are handled asynchronously. I have a draft PR #14353 . I'll resume work on that in March. The current values for queue sizes and thread pool sizes are just guesses. Most likely we will use much lower values to prevent the broker taking in too much work in parallel. That's the essence of back pressure that it limits the in progress work so that incoming requests also slow down. Currently that is not the case since the thread pool queue can grow in an unbounded way (LinkedBlockingQueue is used under the covers). There are several kludges that attempt to add backpressure, but they aren't very effective in Pulsar currently. #14353 will help address backpressure issues in Pulsar Admin API. These problems will come more evident when there are more APIs which are implemented using asynchronous Servlet API. /cc @merlimat @codelipenghui |
Is it better to combine this one and #14353 want to do to one PIP such as PIP-142? The advantage is that we can provide a clearer image to the community that what we want to improve for the REST API part. |
Yes, agree. |
I agree with this proposal and @codelipenghui 's proposal One formality... This looks like a PIP doc. |
Hi, @lhotari @Technoboy- Is there any news in this PIP? |
When more and more asynchronous request handling is happening, it is importance of having a backpressure handling that prevents too much work entering the system. Backpressure handling is broken at the moment. Please review PR #14353. It is fixes bugs in the Admin API / Jetty backpressure configuration. |
Great point @lhotari I would also suggest that thread pool monitoring is also critical to understand
|
…#16287) Master Issue: apache#14365 ### Motivation Please see apache#14365 ### Modifications * Make Namespaces.deleteNamespaceBundle async * Combine internalDeleteNamespaceBundle * Make removeOwnedServiceUnit async
…#16287) Master Issue: apache#14365 ### Motivation Please see apache#14365 ### Modifications * Make Namespaces.deleteNamespaceBundle async * Combine internalDeleteNamespaceBundle * Make removeOwnedServiceUnit async
Close this as we have done all the tracking works |
Co-author: @mattisonchao @Technoboy-
Motivation
The Rest API was originally designed to be implemented asynchronously, but with the iteration of functions, some synchronous implementations were added, resulting in many asynchronous methods called synchronous implementations. Also, many synchronous calls do not add timeouts. This greatly reduces concurrency, user operations, and experience.
In order to prevent more problems, and improve code readability and maintainability, we intend to refactor these synchronous calls and standardize the implementation of the API.
Related discussion: https://lists.apache.org/thread/pkkz2jgwtzpksp6d4rdm1pyxzb3z6vmg
Goals
Modification
Avoid synchronous method calls in asynchronous methods.
Suggest to do like this:
Async variable (AsyncResponse) is placed in the first parameter position
Async variable (AsyncResponse) cannot be substituted into method implementations
Suggest to do like this:
Exception
Some methods will validate ownership, like namespace ownership, topic ownership, so will throw REDIRECT exception. we need to filter this exception and not print log.
Task tracking
In order to unify the modification and track the modified part, it's better to open an issue to track, like #14353, #14013, #13854.
The text was updated successfully, but these errors were encountered: