Improving the handling of mis-configured option value in Chord

17 views
Skip to first unread message

Sai Zhang

unread,
Oct 22, 2013, 7:47:34 PM10/22/13
to chord-...@googlegroups.com
Hello Chord developers,

Not sure this will be of general interest to you. I have been using Chord for a while, and find Chord (sometimes) does not handle misconfiguration well. Specifically, if some options are set to wrong values and Chord exhibit undesired behaviors (i.e., crashing or silent failure), the error messages are absent or not clear enough to localize the misconfigured values. Even worse, sometimes, the incorrect option value is not checked immediately; instead, it propagates through the program and caused some "delayed" problem.  This happens to me a few times. (For me, I have certain knowledge in the Chord src and can fix most configuration errors myself. But I speculate that without a clear error message, it might be difficult for users who are using Chord as blackbox to understand its error root cause).

Here is a simple example just for illustration purpose (I have a couple more examples, and would be happy to post them here if you think this issue is meaningful and should be addressed):

in Program.java

The following code checks whether the srcPathName (configuration option) is null or not, but does not check whether the path exists or not. If a non-existent path is specified as the configuration option value, a less user-friendly error message (a BadOperationException) will show up.

            String srcPathName = Config.srcPathName;
            if (srcPathName == null)
                Messages.fatal(SRC_PATH_NOT_DEFINED);

            String[] srcDirNames = srcPathName.split(Utils.PATH_SEPARATOR);
            try {
                ....
                java2HTML.setJavaDirectorySource(srcDirNames);
                .....
            } catch (Exception ex) {
                throw new RuntimeException(ex);
            }


Thanks.

-Sai

Ariel Rabkin

unread,
Oct 24, 2013, 11:42:19 AM10/24/13
to chord-...@googlegroups.com
Howdy.

Yes, it would be good to have more error checking and reporting. The
difficulty is that the JChord options have a whole bunch of different
types and semantics so it's not clear what the clean way to design it
is.

If you have error handling code that you like, probably the easiest
way to get fixes committed is to mail patches to Mayur? Been a while
since I was an active JChord user/developer so I'm not sure what the
best practice is for improvements.

--Ari
> --
> You received this message because you are subscribed to the Google Groups
> "chord-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to chord-discus...@googlegroups.com.
> To post to this group, send email to chord-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/chord-discuss.
> For more options, visit https://groups.google.com/groups/opt_out.



--
Ari Rabkin asra...@gmail.com
Princeton Computer Science Department
Reply all
Reply to author
Forward
0 new messages