CA command line tools always return 0 (success)

Bug #1741844 reported by Ralph Lange
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
EPICS Base
Confirmed
Medium
Unassigned

Bug Description

Reported by <email address hidden>:

The EPICS caput command has a return code that indicates success/failure.
A successful command returns 0.

However, I am finding it also returns 0 if the command experienced an
exception:

$ caput LOCK1:LOCKGET 124
Old : LOCK1:LOCKGET 124
New : LOCK1:LOCKGET 124
$ echo $?
0

$ caput LOCK1:LOCKGET 123
Old : LOCK1:LOCKGET 124
New : LOCK1:LOCKGET 123
CA.Client.Exception...............................................
    Warning: "Channel write request failed"
    Context: "op=1, channel=LOCK1:LOCKGET, type=DBR_STRING, count=1,
ctx="LOCK1:LOCKGET""
    Source File: ../oldChannelNotify.cpp line 160
    Current Time: Fri Dec 22 2017 16:15:44.013886541
..................................................................

$ echo $?
0

Tags: catools
description: updated
Revision history for this message
mdavidsaver (mdavidsaver) wrote :

I agree that this is undesirable, but I see no way to avoid this for CA put w/o callback. The protocol doesn't define a completion ack. message. So the fact that the client gets the CA exception message at all is a side-effect of the second get. And handling of exception message has always been a weak point of CA implementations.

The only logic I can think of is the return non-zero if any ca exception message is received.
Not sure if this would trigger any false positives though.

Revision history for this message
Andrew Johnson (anj) wrote :

Core Group review at ESS: You should get any exceptions from the ca_put() before the second ca_get() [new value] returns, so MD's logic is probably sufficient.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.