-
Notifications
You must be signed in to change notification settings - Fork 983
HTTPCLIENT-2371: Improved request re-execution strategy #679
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
Conversation
|
What's the context here? What problem are you trying to solve? |
@rschmitt |
|
@ok2c I think there should be a higher bar for breaking API changes than just general cleanup. It's a lot of churn to inflict on users, and a potential source of bugs. There was one issue for the 5.2 -> 5.4 upgrade which I never reported, which involved @Deprecated
public final HttpAsyncClientBuilder setVersionPolicy(final HttpVersionPolicy versionPolicy) {
this.tlsConfig = versionPolicy != null ? TlsConfig.custom().setVersionPolicy(versionPolicy).build() : null;
return this;
}This blows away the prior Additionally, a recurring issue I have as a maintainer is the lack of late binding in many of HC's APIs, especially internal ones. There are vast amounts of constructor delegation, Finally, I've come to realize that Reinier Zwitserloot was right about option types (see also this post). The lack of any type system relationship between Edit: Here's the JEP for null-restricted and nullable types: https://openjdk.org/jeps/8303099 |
|
For constructors, I suggest we use the builder pattern: A builder class (which could be a record in recent Java versions maybe) and one private constructor which takes a builder instance as its single parameter. When you need a new toggle/parameter, you add it to the builder class and update the implementation of the one constructor. |
|
True, but today's deprecation is tomorrow's breaking change, since the goal of deprecation is always in principle to remove the deprecated API.
In my dayjob, I'm responsible for maintaining the Apache client's integration with our main service framework, as well as the rollout of the Apache client itself company-wide, and a number of other open source libraries as well. I have the ability to rebuild an extremely large amount of code against the latest changes to a given library (including running all the unit tests), which means I eventually find and have to deal with every breaking change in every release. (This is why I've had so many bug reports to Log4j2 recently.) So I have a very good sense of how difficult upgrades are at scale, and how limited the "breaking change budget" is for a widely-used library. I prefer to see this budget spent on things like bugfixes, which will often break people who are already broken and don't realize it. (Excessive bugwards compatibility can really stagnate a project.) API reorganizations are okay as long as there's a (working) migration path, but I still think there needs to be a good reason to commit to the eventual removal of an API. Otherwise there's no end to the refactoring that you can do, and I've seen lots of frankly frivolous deprecations cause issues at scale. A good example is Similarly, major version bumps can be reasonable, but there has to be a really compelling reason to do them, and I don't think they should be done more than every ten years or so. I specifically think that JEP 14 is a terrible idea: Java libraries should not follow the latest LTS release of the platform, that's way too much instability at the scale of the Java ecosystem, and we've done well so far with workarounds (like reflection) to make use of newer JDK features (like Unix domain sockets, or ALPN/TLSv1.3 before they got backported to JDK 8 in MR3).
My concern was that |
@arturobernalg @michael-o @rschmitt @garydgregory Please do feel free to take a look at the proposed request re-execution API changes. Do feel free to propose better naming / better API ideas.