1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 <2016> 2017 2018 2019 2020 2021 2022 2023 2024 2025 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 <2016> 2017 2018 2019 2020 2021 2022 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | RE: Simultaneous Channel access |
From: | <[email protected]> |
To: | <[email protected]> |
Date: | Tue, 6 Dec 2016 09:24:03 +0000 |
Hi Marty, Thanks for your reply. In the real application, I don’t have any control over the threads (the calls to Get, RPC are done through a GUI that makes calls to a server which does the request). Though I’ve created
simpler test applications that both include threading, and don’t, and the same issue occurs. I’ve created a test application that demonstrates the issue (see attached) There are two files – PVATest.java and EpicsTestServer.java. The EpicsTestServer.java is just a simple server that listens for connections, and has one pv – “state”. When it receives an RPC call, it changes the state and just pauses for 5 seconds. This can be started as
a standard Java application using the main() method, and should be started before running the tests. The PVATest.java is a JUnit test file with two tests in. The main test that demonstrates the issue is called TestSimulatenous(). It makes an asynchronous RPC call, and then immediately after does a GET. The test
fails because the “Status status2 = pvaChannel2.waitConnect(3);” call in the GET section can’t connect with error ‘channel not connected’ The test can be made to pass by uncommenting the “//Thread.sleep(5000);” which gives the server time to finish processing the RPC call and return. The other test in this class is called TestSimulatenousOnlyGet() and is a copy of the GET section of the first test. If it is run at the same time as the first (i.e. whilst the server is still pausing during
processing of the RPC request) then it can connect and get the state value, showing that the issue isn’t in the server. To get the timings right on this test, I normally debug the tests and the Test Server, with debug points on the line after “// Do Get” in
the first test, and on the “Thread.sleep(5000);” line in the Test Server. This ensures the server is still processing the request when the second test makes its GET request. Thanks again for your help, Matt
-- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. |
Attachment:
EpicsTestServer.java
Description: EpicsTestServer.java
Attachment:
PVATest.java
Description: PVATest.java