PCAS service snap-in has no way to determine if its a put, or a put calback

Bug #541384 reported by Jeff Hill
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
EPICS Base
Fix Released
Wishlist
Jeff Hill

Bug Description

In the CA communication model a put callback request causes a very different interaction model in the IOC core database compared to an ordinary unacknowledged put. The PCAS service should have some way to determine if the write request was intiated by a ca_put or a ca_put_callback.

Original Mantis Bug: mantis-358
    http://www.aps.anl.gov/epics/mantis/view_bug_page.php?f_id=358

Tags: cas 3.14
Revision history for this message
Jeff Hill (johill-lanl) wrote :

It seems that we will need to add an attribute to the GDD that is being passed in.

Revision history for this message
Jeff Hill (johill-lanl) wrote :

To avoid using GDD in ways that it hasn't been used before, and to implement the change as quickly as possible with minimum risk the decision was chosen to implement a fix by making a backwards compatible interface change in casdef.h. Here is the comment from casdef.h describing the change.

    // o The write interface is called when the server receives
    // ca_put request and the writeNotify interface is called
    // when the server receives ca_put_callback request.
    // o A writeNotify request is considered complete and therefore
    // ready for asynchronous completion notification when any
    // action that it initiates, and any cascaded actions, complete.
    // o In an IOC context intermediate write requets can be discarded
    // as long as the final writeRequest is always executed. In an
    // IOC context intermediate writeNotify requests are never discarded.
    // o If the service does not implement writeNotify then
    // the base implementation of casPV :: writeNotify calls
    // casPV :: write, and thereby preserving backwards compatibility
    // with the original interface which included a virtual write
    // method but not a virtual writeNotify method.

Revision history for this message
Jeff Hill (johill-lanl) wrote :
Download full text (10.3 KiB)

committed this fix

cvs diff -wb (in directory epics\base\src\cas\generic\)
Index: casChannel.cc
===================================================================
RCS file: /net/phoebus/epicsmgr/cvsroot/epics/base/src/cas/generic/casChannel.cc,v
retrieving revision 1.16
diff -u -b -w -b -r1.16 casChannel.cc
--- casChannel.cc 16 May 2003 22:05:54 -0000 1.16
+++ casChannel.cc 3 Aug 2009 21:18:16 -0000
@@ -90,6 +90,11 @@
     return ctx.getPV()->write ( ctx, value );
 }

+caStatus casChannel::writeNotify ( const casCtx & ctx, const gdd & value )
+{
+ return ctx.getPV()->writeNotify ( ctx, value );
+}
+
 void casChannel::show ( unsigned level ) const
 {
  if ( level > 2u ) {
Index: casChannelI.cc
===================================================================
RCS file: /net/phoebus/epicsmgr/cvsroot/epics/base/src/cas/generic/casChannelI.cc,v
retrieving revision 1.29.2.1
diff -u -b -w -b -r1.29.2.1 casChannelI.cc
--- casChannelI.cc 18 Jul 2003 15:48:28 -0000 1.29.2.1
+++ casChannelI.cc 3 Aug 2009 21:18:16 -0000
@@ -101,6 +101,17 @@
     return status;
 }

+caStatus casChannelI::writeNotify ( const casCtx & ctx, const gdd & value )
+{
+ caStatus status = this->chan.beginTransaction ();
+ if ( status != S_casApp_success ) {
+ return status;
+ }
+ status = this->chan.writeNotify ( ctx, value );
+ this->chan.endTransaction ();
+ return status;
+}
+
 void casChannelI::postDestroyEvent ()
 {
     if ( ! this->serverDeletePending ) {
Index: casChannelI.h
===================================================================
RCS file: /net/phoebus/epicsmgr/cvsroot/epics/base/src/cas/generic/casChannelI.h,v
retrieving revision 1.6.2.1
diff -u -b -w -b -r1.6.2.1 casChannelI.h
--- casChannelI.h 18 Jul 2003 15:48:08 -0000 1.6.2.1
+++ casChannelI.h 3 Aug 2009 21:28:45 -0000
@@ -54,6 +54,7 @@
  bool confirmationRequested () const;
     caStatus read ( const casCtx & ctx, gdd & prototype );
     caStatus write ( const casCtx & ctx, const gdd & value );
+ caStatus writeNotify ( const casCtx & ctx, const gdd & value );
  void show ( unsigned level ) const;
 private:
     chanIntfForPV privateForPV;
Index: casPV.cc
===================================================================
RCS file: /net/phoebus/epicsmgr/cvsroot/epics/base/src/cas/generic/casPV.cc,v
retrieving revision 1.17
diff -u -b -w -b -r1.17 casPV.cc
--- casPV.cc 10 Mar 2003 22:26:29 -0000 1.17
+++ casPV.cc 3 Aug 2009 21:40:57 -0000
@@ -112,6 +112,18 @@
 }

 //
+// casPV::writeNotify()
+//
+caStatus casPV :: writeNotify (
+ const casCtx & ctx, const gdd & val )
+{
+ // plumbed this way to preserve backwards
+ // compatibility with the old interface which
+ // did not include a writeNotify interface
+ return this->write ( ctx, val );
+}
+
+//
 // casPV::bestExternalType()
 //
 aitEnum casPV::bestExternalType () const
Index: casPVI.cc
===================================================================
RCS file: /net/phoebus/epicsmgr/cvsroot/epics/base/src/cas/generic/casPVI.cc,v
retrieving revision 1.42.2.5
diff -u -b -w -b -r1.42.2.5 casPVI.cc
--- casPVI.cc 9 Jul 2009 15:27:41 -0000 1.42.2.5
+++ casPVI.cc 3 Aug 2009 21:18:16 -0000
@@ -464,6 +464,23 @@
...

Revision history for this message
Jeff Hill (johill-lanl) wrote :

fixed in R3.14.11

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

R3.14.11 released.

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.