jamesnetherton opened a new pull request, #31272: URL: https://github.com/apache/camel/pull/31272
[CAMEL-27927](https://issues.apache.org/jira/browse/CAMEL-27927) When a request gets a 401 and logging in again fails, the request never completes and the caller waits forever. This can happen when a password, client secret or refresh token stops working while a route is running. CAMEL-24161 (701eb46e477e) made concurrent 401s share one login. When that login failed, the request was completed with no response, which the response listeners could not handle. The regression was first released in 4.22.0. ## Changes - `SalesforceSecurityHandler` now passes the original 401 (or Bulk API 400) response along with the login error, so the caller gets the error. - The request also fails, instead of hanging, when the login or the retry throws an unchecked exception. An example is a JWT login with no keystore. - A 401 reply to the login or logout request itself no longer starts another login. The second login waited for the session lock held by the first one, so neither could finish. These replies now go back to the session. The shared login and the other changes of CAMEL-24161 are kept. ## Tests The new `SalesforceReloginFailureTest` runs in the regular build against a local server. It covers a login rejected with a 400, a login rejected with a 401, a logout rejected with a 401, and a login that throws an unchecked exception. `RestApiManualIT.testRetryFailure` caught the regression but only runs in the manual profile. A separate commit contains test fixes only. The replay id tests in `PubSubApiManualIT` could fail when the base64 id contained a `+`, which the endpoint uri decodes to a space. They now use `RAW(...)`. _Claude Code on behalf of jamesnetherton_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
