Commit Graph

1932 Commits

Author SHA1 Message Date
Michael Davidsaver c93f7a35f7 pva/client.h: no lastRequest()
until #97 is resolved.  Avoids annoying message.

https://github.com/epics-base/pvAccessCPP/issues/97
2018-06-29 16:22:57 -07:00
Michael Davidsaver 135f66393d pva/client.h: Get expose valid bitset
turns out this is useful after all.
2018-06-29 16:22:57 -07:00
Michael Davidsaver 80db41f1c4 pva/client.h Allow callbacks to unref Operations
Keep a local (internal) shared_ptr whenever
user callbacks are run.  This allows user
callbacks to drop (reset()/dtor) Operations
or Monitors safely.

Ref must to captured before mutex is locked,
which is safe as the internal weak_ptr is
not changed after build() (despite being non-const)
2018-06-29 16:22:57 -07:00
Michael Davidsaver f29ef3121e pvtools: compose pvutil_ostream
eliminate at least some of the odd-ness which is causing
build failures on hosted mingw.
2018-06-29 16:22:56 -07:00
Michael Davidsaver a1a2e71ecc fix ServerCancelRequestHandler::handleResponse
Thus far this has been dead code as ServerChannel::getRequest()
returned a Destroyable which was actually a BaseChannelRequester
sub-class, not a ChannelRequest sub-class.
2018-06-29 16:22:56 -07:00
Michael Davidsaver 3ffbf9c597 ServerChannel::_requests holds BaseChannelRequester
Make it a bit more obvious that things are backwards here.
2018-06-29 16:22:56 -07:00
Michael Davidsaver 3341d9a2ba spamme example use MonitorFIFO 2018-06-26 19:06:47 -07:00
Michael Davidsaver 5e887a6d02 add MonitorFIFO 2018-06-26 19:06:47 -07:00
Michael Davidsaver 1e04c91d3c Server window fix clear
A leftover from when window_t held MonitorElement::Ref
which it no longer does.
2018-06-26 11:56:51 -07:00
Michael Davidsaver c0126d9a1c server: pipeline=true windowing
Implement flow control windows in the server itself,
so that this applies to all Monitor.

Then the reportRemoteQueueStatus() callback is only needed
to deliver the initial window update.

This is done by not calling Monitor::release() immediately
when pipeline=true.  Rather, hold onto MonitorElement s
until an ack is received.

Also addresses a race with clearing _channelMonitor
vs. having send() queued at/after destroy().
2018-06-26 11:23:50 -07:00
Michael Davidsaver a413f8f9db add dummy ChannelFind implementation.
Since this class is not really used...
2018-06-26 11:23:50 -07:00
Michael Davidsaver 656e2fcfd4 PVA server avoid possible data race
The operation member variable is set by from the
returned pointer, and within the *Connect callback.
Make sure these down race.
2018-06-26 11:23:50 -07:00
Michael Davidsaver 4baa72c91d avoid data race
destroy() sets _serverSocketChannel=INVALID_SOCKET under the lock.
Other changes are made before the worker thread starts.
2018-06-26 10:45:14 -07:00
mrkraimer f83c6c87d6 remove warnings andrew saw while building testCaProvider.cpp 2018-06-26 08:43:40 -04:00
Michael Davidsaver 1ba48868f6 PVA server avoid lock order violation
There is a lock order violation when a server force disconnects it's clients while sending a final message to it (or concurrent close, or probably others). The entry points are channelStateChange() and operation send().

Fix is not to hold the channel mutex when destroy()ing operations.

epics::pvAccess::ServerChannelRPCRequesterImpl::destroy
  locks RPC requester mutex
epics::pvAccess::ServerChannel::destroy
  locks channel mutex
epics::pvAccess::ServerChannelRequesterImpl::channelStateChange


epics::pvAccess::ServerChannel::unregisterRequest
  locks channel mutex
epics::pvAccess::ServerChannelRPCRequesterImpl::destroy
  locks RPC requester mutex
epics::pvAccess::ServerChannelRPCRequesterImpl::send
2018-06-25 19:52:10 -07:00
mrkraimer 02cf890d60 fix spaces in headers 2018-06-25 14:42:40 -04:00
mrkraimer 98a019aec8 fix document title 2018-06-25 14:38:08 -04:00
mrkraimer b871b2de86 caProvider.md is documentation for provider ca 2018-06-25 14:00:24 -04:00
Michael Davidsaver 4b3237a20d BlockingUDPTransport::enqueueSendRequest cleanup?
oh my was this bad code!  It isn't clear what
lock()/unlock() are guarding, but let them
continue as before, but don't swallow any exception,
or unlock twice.
2018-06-22 13:28:49 -07:00
Michael Davidsaver d424202323 client: exception propagation from callbacks
Swallowing exceptions here hides some of our errors.
Particularly unrecoverable introspectionRegistry misses.
Instead, propagate up to Thread and close connection.
2018-06-22 13:28:49 -07:00
Michael Davidsaver 1670ff8f7c SerializationHelper cleanup and add error checks 2018-06-22 13:28:49 -07:00
Michael Davidsaver 3abd77a42c fix IntrospectionRegistry error handling
Calling code can't deal with "cache" miss,
which indicates either a protocol error (use of invalid ID),
or a logic error on our part (didn't save ID).
In either case, better to throw an exception than to crash.
2018-06-22 13:28:49 -07:00
Michael Davidsaver e08de8c2df detect Structure caching error
The assert in the client side copy is hit during
some kind of failure to keep the Field cache
up to date.
2018-06-22 13:28:49 -07:00
mrkraimer 184e92b346 delete stopMonitorThread; add monitorEventThread 2018-06-19 13:11:01 -04:00
mrkraimer 43111a2195 Merge https://github.com/epics-base/pvAccessCPP 2018-06-10 15:20:49 -04:00
mrkraimer c377d35aee StopMonitorThread addNoEventsCallback replaces waitForNoEvent 2018-06-10 14:28:23 -04:00
mrkraimer fe8184cf95 added aux thread to call ca_clear_subscription 2018-06-08 15:22:08 -04:00
Michael Davidsaver de6586b92f MonitorElement::Ref swap() and move, but no copy 2018-06-05 09:32:22 -07:00
Michael Davidsaver 578dbc9456 add another ChannelProviderRegistry::addSingleton() overload
Construct a "factory" around a pre-allocated instance.
2018-06-05 09:32:22 -07:00
Michael Davidsaver 8000ed0637 client.h default ctor for ClientProvider
Allow an invalid ClientProvider to be created
for later assignment.
2018-06-05 09:32:22 -07:00
Michael Davidsaver c8292caf91 remote: Request larger stack for workers
Overflows observed on RTEMS/ppc (mvme6100).
2018-06-04 10:08:01 -07:00
Michael Davidsaver 794d72ba6b client.h MonitorSync missing init of member 2018-06-04 10:08:01 -07:00
Marty Kraimer 673edb27e1 Merge pull request #3 from anjohnson/master
Travis-CI fixes
2018-05-29 08:33:45 -04:00
Michael Davidsaver 44132be716 avoid MSVC min()/max() conflict 2018-05-28 10:19:48 -07:00
Andrew Johnson 30fcce2a9c testCa: Add missing source file to embedded builds 2018-05-28 11:07:13 -05:00
Andrew Johnson 720335e537 testCa: export EPICS_HOST_ARCH unconditionally 2018-05-28 11:05:42 -05:00
Marty Kraimer 4f3d0375fe Merge pull request #2 from anjohnson/master
More updates & fixes
2018-05-28 06:37:49 -04:00
Andrew Johnson 7bf404913a testCa: Move IOC environment checks & configuration from run() to start()
This lets us use testAbort() instead of throw to flag errors.
2018-05-27 15:42:31 -05:00
Andrew Johnson 6681bdc4c6 testCa: Embedded IOCs need Base-3.16.2 or higher 2018-05-27 15:42:31 -05:00
Andrew Johnson 206d080de1 testCa: Fix version check for Base-3.14 builds 2018-05-27 15:42:31 -05:00
Andrew Johnson eacfbeeea8 Building testCa requires src/ca 2018-05-27 15:42:31 -05:00
Marty Kraimer bbb2ad3de8 Merge pull request #1 from anjohnson/master
Changes to your pvAccess/testCa code

Andrew,

Thanks
2018-05-27 06:31:48 -04:00
Andrew Johnson 2cddd3359e testCa: Replace duplicated test code with a subroutine
Also uses testAbort() instead of throwing in the event of a problem.
2018-05-27 01:25:25 -04:00
Andrew Johnson c57b135235 testCa: Configure CA to search localhost only 2018-05-27 01:14:47 -04:00
Andrew Johnson db15689e1c testCa: Use the softIoc's built-in exit subrecord 2018-05-27 00:33:18 -04:00
Andrew Johnson 872004f75f testCa: Run IOC using dbUnitTest API where possible
Essential for VxWorks and RTEMS which don't support system().
Build embedded IOC tests only against Base-3.15 and later.
2018-05-27 00:31:32 -04:00
Andrew Johnson 3e0748d488 testCa: Adjust test output
The DEBUG flag must be 0 when running under a test harness to
remove extraneous output which can confuse the output parser.
This commit also converts some throws into tests, and adds
more test diagnostic messages.
2018-05-26 13:23:04 -04:00
Andrew Johnson d155487dda testCa: Remove extraneous bi record, fix bo.OUT link 2018-05-26 13:13:28 -04:00
mrkraimer 08290b4a99 Merge https://github.com/epics-base/pvAccessCPP 2018-05-23 15:18:30 -04:00
Michael Davidsaver 12e7b7864b fix s_channelNameToProvider hack
Move from global to ServerContext, apply lock, and
properly test if no provider has claimed, eg an attempt
at unadvertised PV (still wouldn't work, but at least
wouldn't crash).
2018-05-18 17:04:07 -07:00