Skip to content

Commit

Permalink
[Extensions] Fixed duplicate extension unique id (#8228)
Browse files Browse the repository at this point in the history
* Fixes duplicate extension unique id

Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>

* Handled different extension unique id

Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>

---------

Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
(cherry picked from commit f21d73e)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Jun 23, 2023
1 parent 79bf769 commit bbdb5c8
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,10 @@ public ConnectionManager.ConnectionValidator connectionValidatorForExtensionConn
) {
return (newConnection, actualProfile, listener) -> {
// We don't validate cluster names to allow for CCS connections.
threadPool.getThreadContext().putHeader("extension_unique_id", extensionUniqueId);
String currentId = threadPool.getThreadContext().getHeader("extension_unique_id");
if (Strings.isNullOrEmpty(currentId) || !extensionUniqueId.equals(currentId)) {
threadPool.getThreadContext().putHeader("extension_unique_id", extensionUniqueId);
}
handshake(newConnection, actualProfile.getHandshakeTimeout().millis(), cn -> true, ActionListener.map(listener, resp -> {
final DiscoveryNode remote = resp.discoveryNode;

Expand Down

0 comments on commit bbdb5c8

Please sign in to comment.