Github user zhan849 commented on a diff in the pull request: https://github.com/apache/helix/pull/152#discussion_r176204863 --- Diff: helix-core/src/main/java/org/apache/helix/util/HelixUtil.java --- @@ -219,4 +220,22 @@ public static String serializeByComma(List<String> objects) { return idealStateMap; } + + /** + * Remove the given message from ZK using the given accessor. This function will + * not throw exception + * @param accessor HelixDataAccessor + * @param msg message to remove + * @param instanceName name of the instance on which the message sits + * @return true if success else false + */ + public static boolean removeMessageFromZK(HelixDataAccessor accessor, Message msg, + String instanceName) { + try { + return accessor.removeProperty(msg.getKey(accessor.keyBuilder(), instanceName)); + } catch (Exception e) { --- End diff -- it will not. the reason I did a general try-catch here is because I want to keep removeProperty semantics (only return true/false) here, but we do have leaked exception in underlying implementations of removeProperty()
---