You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@storm.apache.org by "Jason Kania (JIRA)" <ji...@apache.org> on 2017/03/18 03:52:41 UTC

[jira] [Created] (STORM-2424) Supervisor fails silently if started with old supervisor/localstate content

Jason Kania created STORM-2424:
----------------------------------

             Summary: Supervisor fails silently if started with old supervisor/localstate content
                 Key: STORM-2424
                 URL: https://issues.apache.org/jira/browse/STORM-2424
             Project: Apache Storm
          Issue Type: Bug
          Components: storm-core
    Affects Versions: 1.0.3
            Reporter: Jason Kania


If the following method in LocalState encounters an Exception and throws a RuntimeException, the supervisor quits silently without generating an error. I had to debug this by connecting with a remote debugger. Instead the method should generate an error to the user as to the source of the error. In my case, because I was upgrading my installation, the problem was due to a missing parameter in the content under the supervisor/localstate directory.

    private Map<String, ThriftSerializedObject> partialDeserializeLatestVersion(TDeserializer td) {
        try {
            String latestPath = _vs.mostRecentVersionPath();
            Map<String, ThriftSerializedObject> result = new HashMap<>();
            if (latestPath != null) {
                byte[] serialized = FileUtils.readFileToByteArray(new File(latestPath));
                if (serialized.length == 0) {
                    LOG.warn("LocalState file '{}' contained no data, resetting state", latestPath);
                } else {
                    if (td == null) {
                        td = new TDeserializer();
                    }
                    LocalStateData data = new LocalStateData();
                    td.deserialize(data, serialized);
                    result = data.get_serialized_parts();
                }
            }
            return result;
        } catch(Exception e) {
            throw new RuntimeException(e);
        }
    }



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