[jira] [Commented] (CASSANDRA-13356) BootstrapMonitor.progress does not store all error messages

2017-03-30 Thread Paulo Motta (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-13356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15949318#comment-15949318
 ] 

Paulo Motta commented on CASSANDRA-13356:
-

Thanks for the patch. I'm afraid this will not work yet because it will throw 
the exception to the JMX notifier and not to the client which will still hang. 
You need to do something similar to the {{RepairRunner}} which will store the 
exception and signal completion to the client, which will then display the 
exception.

Can you test this manually before submitting a new patch? You can use 
[ccm|https://github.com/pcmanus/ccm] to bring up a cluster and you may induct a 
streaming/bootstrap failure with the following code:
{noformat}
diff --git a/src/java/org/apache/cassandra/streaming/StreamSession.java 
b/src/java/org/apache/cassandra/streaming/StreamSession.java
index d57fae8..4a91af3 100644
--- a/src/java/org/apache/cassandra/streaming/StreamSession.java
+++ b/src/java/org/apache/cassandra/streaming/StreamSession.java
@@ -731,6 +731,10 @@ public class StreamSession implements 
IEndpointStateChangeSubscriber
 
 private void startStreamingFiles()
 {
+if (true)
+{
+throw new RuntimeException("hoho");
+}
 streamResult.handleSessionPrepared(this);
 
 state(State.STREAMING);
{noformat}

If you're feeling adventurous you may try to add a new 
[cassandra-dtest|https://github.com/riptano/cassandra-dtest/] based on 
{{bootstrap_test.py:resumable_bootstrap_test}}.

> BootstrapMonitor.progress does not store all error messages
> ---
>
> Key: CASSANDRA-13356
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13356
> Project: Cassandra
>  Issue Type: Bug
>  Components: Tools
>Reporter: Hao Zhong
>Assignee: Hao Zhong
>  Labels: lhf
> Fix For: 4.x
>
> Attachments: cassandra.patch
>
>
> The BootstrapMonitor.progress ignores error messages when an error is 
> ProgressEventType.ERROR. Indeed, RepairRunner.progress once had a similar 
> bug, but is fixed. The fixed code is:
> {code}
>  public void progress(String tag, ProgressEvent event)
> {
> ProgressEventType type = event.getType();
> String message = String.format("[%s] %s", 
> format.format(System.currentTimeMillis()), event.getMessage());
> if (type == ProgressEventType.PROGRESS)
> {
> message = message + " (progress: " + 
> (int)event.getProgressPercentage() + "%)";
> }
> out.println(message);
> if (type == ProgressEventType.ERROR)
> {
> error = new RuntimeException("Repair job has failed with the 
> error message: " + message);
> }
> if (type == ProgressEventType.COMPLETE)
> {
> condition.signalAll();
> }
> }
> {code}
> Please refer to CASSANDRA-12508 for details.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (CASSANDRA-13356) BootstrapMonitor.progress does not store all error messages

2017-03-20 Thread Jeff Jirsa (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-13356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15934113#comment-15934113
 ] 

Jeff Jirsa commented on CASSANDRA-13356:


Hello [~haozhong] - thanks for the bug report. Are you able to follow the 
procedure defined in the 
[documentation|http://cassandra.apache.org/doc/latest/development/patches.html#creating-a-patch]
 for creating a patch? We typically need a patch for each impacted branch, and 
then a reviewer can run unit tests for you and commit.


> BootstrapMonitor.progress does not store all error messages
> ---
>
> Key: CASSANDRA-13356
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13356
> Project: Cassandra
>  Issue Type: Bug
>  Components: Tools
>Reporter: Hao Zhong
> Fix For: 4.x
>
>
> The BootstrapMonitor.progress ignores error messages when for 
> ProgressEventType.ERROR. Indeed, RepairRunner.progress once had a similar 
> bug, but is fixed. The fixed code is:
> {code}
>  public void progress(String tag, ProgressEvent event)
> {
> ProgressEventType type = event.getType();
> String message = String.format("[%s] %s", 
> format.format(System.currentTimeMillis()), event.getMessage());
> if (type == ProgressEventType.PROGRESS)
> {
> message = message + " (progress: " + 
> (int)event.getProgressPercentage() + "%)";
> }
> out.println(message);
> if (type == ProgressEventType.ERROR)
> {
> error = new RuntimeException("Repair job has failed with the 
> error message: " + message);
> }
> if (type == ProgressEventType.COMPLETE)
> {
> condition.signalAll();
> }
> }
> {code}
> Please refer to CASSANDRA-12508 for details.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)