System.alarm.acknowledge() consistently throws TypeError: cannot compare sets using cmp() in Perspective Session

Your code formatting got mangled - see Wiki - how to post code on this forum.

Is there any more detail in the stacktrace? An exact line number?

It's an internal error in Jython, in how Java Set objects are adapted into Python(ish) set objects. But none of the code you've posted should be causing it.

This probably isn't relevant, but you could try changing this line:
logger.info("ack result: " + str(result))
To this:
logger.infof("ack result: %s", result)