casChannel::writeNotify should call casChannel::write
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
EPICS Base |
Won't Fix
|
Medium
|
Jeff Hill |
Bug Description
Executive Summary:
=================
I believe that you have found a bug. There are at least four permutations using these abbreviations new gateway (NGW), old gateway (OGW), new CAS server library (NCAS), and old CAS server library (OCAS).
{NGW, NCAS} (no bug)
{OGW, NCAS} (bug, your situation)
{NGW, OCAS} (probably no bug, but bad old behavior not updating clients when write notify is in progress)
{OGW, OCAS} (no bug)
Detailed explanation:
=================
First some background info.
When inspecting casdef.h (defining the interface between the server and services) one can see two interfaces casPV and casChannel. Both of them have a similar virtual functions for implementing read, write, and writeNotify etc in the service. The casPV interface was first and it can be used when the PV is client agnostic in the service (its behavior does not change depending on what client is attached). In contrast, the casChannel interface was added later for services which need to implement a PV that has a behavior which is different depending on what client is attached, or for implementing behavior that requires client specific state variables. To maintain backwards compatibility the base class casChannel forwards requests such as read, write, or writeNotify to the interface in casPV. This happens when the service does not implement a factory for casChannel derived objects.
Furthermore, in the original casPV interface there was only a “write” interface. Sometime back we discovered that it was difficult to have a robust implementation of the gateway if the gateway was unable to determine if the CA request was a put, or a put notify. Therefore, a new writeNotify interface was added so that the gateway could be improved wrt put notify requests (as I recall the old gateway would stop updating its clients when a put notify request was pending). Of course to maintain backwards compatibility the writeNotify interface calls the write interface if the service doesn’t implement writeNotify.
casChannel::write is calling
Ok now about resolving your issue.
I believe that casChannel:
Changed in epics-base: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
assignee: | nobody → Jeff Hill (johill-lanl) |
milestone: | none → 3.14.branch |
tags: | added: cas pcas server service |
Considering this matter further, the situation is more complicated than it initially appeared.
To completely fix the problem there will need to be two changes as follows.
1) casChannel: :writeNotify should call casChannel::write
2) We need also a new class casChannelDefault which forwards all of its virtual function directly to the casPV interface. A casChannelDefault object shall be created only when the user doesn't implement a factory for the casChannel interface in casPV.