How to terminate execution if node stuck?

In my case its unexpectedly long calculation in Java Snippet node which tries to match a long RegEx with a text. And i cannot stop it except killing knime.exe process :'( 

Speaking in general - i think it might be a useful feature - emergency termination of execution if its taking long time.

Speaking about my case - RegEx which a trying to match:


p = Pattern.compile(".*<a.*href=\"(.*)\".*>.*mykeyword.*</a>.*", Pattern.DOTALL );
m = p.matcher(str);
What i did wrong? :)


Hi, I understand your problem, but I think there are problems with your code too... I think you do not need .* to the beginning and the end if you use find() method on m. Also I do not think this will ever match on any str. You should use .*? (reluctant classifier)

Hope this helps.

PS.: I have not tried, but you might try launching a new thread and kill if there is an execution cancelled exception. Maybe the forkjoin framework be an option too.

You were right about reluctant quantifier. But Java Snippet dont give me right result anyway =)

I solve problem by preparation of text before matching it - i extracted all <a></a> tags firstly and then match results with regex i wrote in starting text but with reluctant quantifiers instead of greedy.