Commit Graph

1587 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
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
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
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
Michael Davidsaver 44132be716 avoid MSVC min()/max() conflict 2018-05-28 10:19:48 -07: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
Michael Davidsaver 7a523dd948 drop unused NOMINMAX 2018-05-18 15:20:26 -07:00
Michael Davidsaver ba41fa6d62 notes 2018-05-18 15:17:27 -07:00
Michael Davidsaver ce19199edd cleanup 2018-05-18 11:58:35 -07:00
Michael Davidsaver 6ccca1ce58 const-ify string constants
yes really...
2018-05-18 10:12:34 -07:00
Michael Davidsaver 6abfe9d196 server: cleanup handling of vector of providers
avoid keeping extra refs.  situation is confusing
enough as it is.
2018-05-18 08:53:52 -07:00
Michael Davidsaver bd88e35448 client.h update doc 2018-05-16 09:14:49 -07:00
Michael Davidsaver 51fdd506d0 update release notes 6.1.0-pre1 2018-04-24 13:50:59 -07:00
Michael Davidsaver a75720120c client: call ChannelSearchManager::cancel() 2018-04-24 12:33:54 -07:00
Michael Davidsaver 1adea89e77 pvtools: combine separator and fieldSeparator
both always have the same value anyway...
2018-04-24 08:33:25 -07:00
Michael Davidsaver 9c25057d80 pvtools: drop unnecessary accessors for global flags
These don't provide any encapsulation or validation...
2018-04-24 08:29:45 -07:00
Andrew C. Starritt a2b60771c2 pvget -m show time/alarm
MD: cleanups
2018-04-24 07:36:06 -07:00
Michael Davidsaver 7cf78d5b9b client.h add ClientProvider::name() 2018-04-20 15:22:57 -07:00
Michael Davidsaver 3d85852c93 attempt to fix dllimport issue 2018-04-18 09:01:11 -07:00
Michael Davidsaver 61d43e498d client.h std::ostream printing 2018-04-10 16:19:03 -07:00
Michael Davidsaver 0d40464541 client.h: expose reset()
can also be accomplished with assignment from empty.

op = pvac::Operation()
2018-04-10 15:17:18 -07:00
Michael Davidsaver 0c6fe2c1c6 client.h: add validity test for all handles 2018-04-08 16:04:36 -07:00
Michael Davidsaver ff5d51b221 server: shorter name for Timer thread 2018-04-04 20:55:57 -07:00
Michael Davidsaver 1e0523b7b9 client context. Prevent transport dtor under channel mutex.
m_channelMutex is locked recursively, so places like
disconnect(bool,bool) which purport to unlock for the
Transport detory actually don't as they are called
with m_channelMutex already locked.

Make a rather ugly hack of saving a ref to m_channel
at the various entry point.
2018-04-04 19:25:04 -07:00
Michael Davidsaver c9c8fb369a client context explicitly close() timer queue 2018-04-04 18:53:22 -07:00
Michael Davidsaver d4822f141c simplify InternalClientContextImpl::destroy()
Collapse internalDestroy() into destroy()
2018-04-04 18:50:58 -07:00
Michael Davidsaver 128d4b67f9 simplify InternalChannelImpl::destroy()
Collapse channel destroy(bool) and destroyChannel() into destroy()
2018-04-04 18:48:48 -07:00
Michael Davidsaver e97354db61 client context collapse channel createChannel() into searchResponse() 2018-04-04 18:44:11 -07:00
Michael Davidsaver bab32c332a codec: notes on thread self dtor 2018-04-04 18:40:46 -07:00
Michael Davidsaver 54bb30fd86 reftrack BlockingUDPTransport 2018-04-04 18:31:12 -07:00