You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "Jan Høydahl (Jira)" <ji...@apache.org> on 2024/12/06 15:54:00 UTC
[jira] [Comment Edited] (SOLR-17586) Deprecation of zkcli.sh broke solr operator
[ https://issues.apache.org/jira/browse/SOLR-17586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17903695#comment-17903695 ]
Jan Høydahl edited comment on SOLR-17586 at 12/6/24 3:53 PM:
-------------------------------------------------------------
So turns out that Commons CLI uses a default deprecation handler that prints to stdout :( see [https://github.com/apache/commons-cli/blob/master/src/main/java/org/apache/commons/cli/CommandLine.java#L53]
It would be a simple matter to set another deprecation handler in {{{}ZkCLI{}}}, but turns out that [Option's toDeprecatedString() method|https://github.com/apache/commons-cli/blob/master/src/main/java/org/apache/commons/cli/Option.java#L972-L987] is not public so we need to fork that method.
I'll add both these to the PR. Smells an upstream Jira for Commons CLI as well.
Ping [~epugh]
*EDIT:* Used the overriden deprecatedhandler from SolrCLI, which had the same issue before
was (Author: janhoy):
So turns out that Commons CLI uses a default deprecation handler that prints to stdout :( see [https://github.com/apache/commons-cli/blob/master/src/main/java/org/apache/commons/cli/CommandLine.java#L53]
It would be a simple matter to set another deprecation handler in {{{}ZkCLI{}}}, but turns out that [Option's toDeprecatedString() method|https://github.com/apache/commons-cli/blob/master/src/main/java/org/apache/commons/cli/Option.java#L972-L987] is not public so we need to fork that method.
I'll add both these to the PR. Smells an upstream Jira for Commons CLI as well.
Ping [~epugh]
> Deprecation of zkcli.sh broke solr operator
> -------------------------------------------
>
> Key: SOLR-17586
> URL: https://issues.apache.org/jira/browse/SOLR-17586
> Project: Solr
> Issue Type: Bug
> Security Level: Public(Default Security Level. Issues are Public)
> Components: scripts and tools
> Affects Versions: 9.7
> Reporter: Jan Høydahl
> Assignee: Jan Høydahl
> Priority: Blocker
> Labels: pull-request-available
> Fix For: 9.8
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> In SOLR-14115 we deprecated zkcli.sh. A deprecation echo was added to the script in 9.x and it was removed in 10.0.
> Turns out the deprecation message is always printed (stdout) thus breaking scripts that rely on capturing the output from the script when used with {{{}-cmd get{}}}.
> This can be fixed by echoing to stderr instead with
> {code:bash}
> >&2 echo "foo"
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org