reset status in getCache (PVDataHolder) following put with nowtaccess error

This commit is contained in:
2021-10-17 16:43:20 +02:00
parent 90e063f930
commit 80ce12d374
5 changed files with 89 additions and 46 deletions

View File

@@ -721,8 +721,8 @@ template <class CTYPE> int Instant<CTYPE>::getCache(const unsigned int _handle
{
#define __METHOD__ "Instant::getCache(_handle, _dbrType, _val, alarmStatus, alarmSeverity, ts) "
//std::cout << __FILE__ << " " << __LINE__ << " " << __METHOD__ << std::endl;
//std::cout << "handle " << _handle << " dbr input type " << _dbrType << std::endl;
//std::cout << __FILE__ << " " << __LINE__ << " " << __METHOD__ << std::endl;
//std::cout << "handle " << _handle << " dbr input type " << _dbrType << std::endl;
status=ICAFE_NORMAL;
@@ -801,19 +801,8 @@ template <class CTYPE> int Instant<CTYPE>::getCache(const unsigned int _handle
}
//ifNeverConnected - return error
if ( (*it_handle).getChannelRegalia().getCafeConnectionState() == ICAFE_CS_NEVER_CONN)
{
return ICAFE_CS_NEVER_CONN;
}
else if ( (*it_handle).getChannelRegalia().getCafeConnectionState()==ICAFE_CS_CLOSED)
{
return ICAFE_CS_CLOSED;
}
//Reset any put error
//Reset any possible put error that preceded call to getCache
if ( (*it_handle).getStatus() == ECAFE_NOWTACCESS ||
(*it_handle).getStatus() == ECA_PUTFAIL ||
(*it_handle).getStatus() == ECA_PUTCBINPROG) {
@@ -832,6 +821,17 @@ template <class CTYPE> int Instant<CTYPE>::getCache(const unsigned int _handle
//ifNeverConnected - return error
if ( (*it_handle).getChannelRegalia().getCafeConnectionState() == ICAFE_CS_NEVER_CONN)
{
return ICAFE_CS_NEVER_CONN;
}
else if ( (*it_handle).getChannelRegalia().getCafeConnectionState()==ICAFE_CS_CLOSED)
{
return ICAFE_CS_CLOSED;
}
// Meant for use in callbacks in monitors!
// Does not check what the client is requesting.
@@ -1114,7 +1114,6 @@ template <class CTYPE> int Instant<CTYPE>::getCache(const unsigned int *handleA
{
//Very possibly waveforems will need longer to report back!
if(helper.getNelemNative(handleArray[i])!=1)
{
@@ -1274,10 +1273,11 @@ template <class CTYPE> int Instant<CTYPE>::getCache(const unsigned int *handleA
dbr_short_t a1, a2;
epicsTimeStamp ts1;
//std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl;
statusArray[i]=Instant::getCache(handleArray[i], _dbrType, &val[i],
a1, a2, ts1);
//std::cout << "status " << statusArray[i] << std::endl;
chtype channelType= _dbrType;
if (dbr_type_is_TIME(channelType))

View File

@@ -1,16 +1,18 @@
bitshuffle/bitshuffle.lo: bitshuffle/bitshuffle.c bitshuffle/bitshuffle.h \
/usr/include/stdlib.h /usr/include/features.h /usr/include/sys/cdefs.h \
bitshuffle/bitshuffle.lo: bitshuffle/bitshuffle.c \
/usr/include/stdc-predef.h bitshuffle/bitshuffle.h /usr/include/stdlib.h \
/usr/include/features.h /usr/include/sys/cdefs.h \
/usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
/usr/include/gnu/stubs-64.h \
/afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/stddef.h \
/usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \
/usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/bits/byteswap.h /usr/include/sys/types.h \
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
/usr/include/time.h /usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/bits/time.h \
/usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \
/usr/include/alloca.h bitshuffle/bitshuffle_core.h \
/usr/include/bits/byteswap.h /usr/include/bits/types.h \
/usr/include/bits/typesizes.h /usr/include/bits/byteswap-16.h \
/usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/bits/time.h /usr/include/sys/sysmacros.h \
/usr/include/bits/pthreadtypes.h /usr/include/alloca.h \
/usr/include/bits/stdlib-float.h bitshuffle/bitshuffle_core.h \
/afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/stdint.h \
/usr/include/stdint.h /usr/include/bits/wchar.h \
bitshuffle/bitshuffle_internals.h bitshuffle/iochain.h \
@@ -21,6 +23,8 @@ bitshuffle/bitshuffle.lo: bitshuffle/bitshuffle.c bitshuffle/bitshuffle.h \
/usr/include/bits/stdio.h /usr/include/string.h /usr/include/xlocale.h \
/usr/include/bits/string.h /usr/include/bits/string2.h
/usr/include/stdc-predef.h:
bitshuffle/bitshuffle.h:
/usr/include/stdlib.h:
@@ -47,12 +51,14 @@ bitshuffle/bitshuffle.h:
/usr/include/bits/byteswap.h:
/usr/include/sys/types.h:
/usr/include/bits/types.h:
/usr/include/bits/typesizes.h:
/usr/include/bits/byteswap-16.h:
/usr/include/sys/types.h:
/usr/include/time.h:
/usr/include/sys/select.h:
@@ -69,6 +75,8 @@ bitshuffle/bitshuffle.h:
/usr/include/alloca.h:
/usr/include/bits/stdlib-float.h:
bitshuffle/bitshuffle_core.h:
/afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/stdint.h:

View File

@@ -1,5 +1,5 @@
bitshuffle/bitshuffle_core.lo: bitshuffle/bitshuffle_core.c \
bitshuffle/bitshuffle_core.h \
/usr/include/stdc-predef.h bitshuffle/bitshuffle_core.h \
/afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/stdint.h \
/usr/include/stdint.h /usr/include/features.h /usr/include/sys/cdefs.h \
/usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
@@ -8,12 +8,13 @@ bitshuffle/bitshuffle_core.lo: bitshuffle/bitshuffle_core.c \
/afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/stddef.h \
/usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \
/usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/bits/byteswap.h /usr/include/sys/types.h \
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
/usr/include/time.h /usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/bits/time.h \
/usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \
/usr/include/alloca.h bitshuffle/bitshuffle_internals.h \
/usr/include/bits/byteswap.h /usr/include/bits/types.h \
/usr/include/bits/typesizes.h /usr/include/bits/byteswap-16.h \
/usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/bits/time.h /usr/include/sys/sysmacros.h \
/usr/include/bits/pthreadtypes.h /usr/include/alloca.h \
/usr/include/bits/stdlib-float.h bitshuffle/bitshuffle_internals.h \
bitshuffle/iochain.h /usr/include/stdio.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/wchar.h \
/afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/stdarg.h \
@@ -25,6 +26,8 @@ bitshuffle/bitshuffle_core.lo: bitshuffle/bitshuffle_core.c \
/afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/mmintrin.h \
/afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/mm_malloc.h
/usr/include/stdc-predef.h:
bitshuffle/bitshuffle_core.h:
/afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/stdint.h:
@@ -57,12 +60,14 @@ bitshuffle/bitshuffle_core.h:
/usr/include/bits/byteswap.h:
/usr/include/sys/types.h:
/usr/include/bits/types.h:
/usr/include/bits/typesizes.h:
/usr/include/bits/byteswap-16.h:
/usr/include/sys/types.h:
/usr/include/time.h:
/usr/include/sys/select.h:
@@ -79,6 +84,8 @@ bitshuffle/bitshuffle_core.h:
/usr/include/alloca.h:
/usr/include/bits/stdlib-float.h:
bitshuffle/bitshuffle_internals.h:
bitshuffle/iochain.h:

View File

@@ -1,16 +1,19 @@
bitshuffle/iochain.lo: bitshuffle/iochain.c /usr/include/stdlib.h \
/usr/include/features.h /usr/include/sys/cdefs.h \
bitshuffle/iochain.lo: bitshuffle/iochain.c /usr/include/stdc-predef.h \
/usr/include/stdlib.h /usr/include/features.h /usr/include/sys/cdefs.h \
/usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
/usr/include/gnu/stubs-64.h \
/afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/stddef.h \
/usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \
/usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/bits/byteswap.h /usr/include/sys/types.h \
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
/usr/include/time.h /usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/bits/time.h \
/usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \
/usr/include/alloca.h bitshuffle/iochain.h
/usr/include/bits/byteswap.h /usr/include/bits/types.h \
/usr/include/bits/typesizes.h /usr/include/bits/byteswap-16.h \
/usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/bits/time.h /usr/include/sys/sysmacros.h \
/usr/include/bits/pthreadtypes.h /usr/include/alloca.h \
/usr/include/bits/stdlib-float.h bitshuffle/iochain.h
/usr/include/stdc-predef.h:
/usr/include/stdlib.h:
@@ -36,12 +39,14 @@ bitshuffle/iochain.lo: bitshuffle/iochain.c /usr/include/stdlib.h \
/usr/include/bits/byteswap.h:
/usr/include/sys/types.h:
/usr/include/bits/types.h:
/usr/include/bits/typesizes.h:
/usr/include/bits/byteswap-16.h:
/usr/include/sys/types.h:
/usr/include/time.h:
/usr/include/sys/select.h:
@@ -58,4 +63,6 @@ bitshuffle/iochain.lo: bitshuffle/iochain.c /usr/include/stdlib.h \
/usr/include/alloca.h:
/usr/include/bits/stdlib-float.h:
bitshuffle/iochain.h:

View File

@@ -650,6 +650,27 @@ int CAFE::getCache(const unsigned int handle, PVDataHolder & pvd)
if (it_handle != handle_index.end())
{
//Reset any possible put error that preceded call to getCache
if ( (*it_handle).getStatus() == ECAFE_NOWTACCESS ||
(*it_handle).getStatus() == ECA_PUTFAIL ||
(*it_handle).getStatus() == ECA_PUTCBINPROG) {
if(MUTEX)
{
cafeMutex.lock();
}; //lock
//std::cout << "getStatus - before:" << (*it_handle).getStatus() << std::endl;
handle_index.modify(it_handle, change_status(ICAFE_NORMAL));
pvd.status = ICAFE_NORMAL;
//std::cout << "getStatus - after:" << (*it_handle).getStatus() << std::endl;
if(MUTEX)
{
cafeMutex.unlock();
}; //unlock
}
//meant for use in callbacks in monitors!
if ( (*it_handle).getChannelGetCacheWaitPolicy().getWaitKind() == CAFENUM::GET_CACHE_NO_CHECK)
{