Open GoogleCodeExporter opened 9 years ago
[deleted comment]
[deleted comment]
IMPORTANT UPDATE
================
Upon further study, the root cause actually might have nothing to do with
Access Control cache on the exact sequence to reproduce this error. Instead,
it has to do with step 8), where Shutdown of Service2 is not resulting in its
first Session owning all the occupied channels to be released properly.
On the client side, the workaround on this issue is to keep reference to the
session and explicitly call Session.closeChannels() or Session.close().
So, instead of this being a access control issue, it is instead issue on not
cleaning up properly problem with SEService shutdown().
Original comment by etpcc...@gmail.com
on 10 Sep 2014 at 3:52
UPDATE
======
it has been identified that the following would close all the occupied channels
probably
session.close();
session.closeChannels();
session.getReader().closeSessions();
but the following would not
session.getReader().getSEService().shutdown();
Based upon this knowledge, it has been identified that the root cause is in
SEService getReaders() function, where getReaders would dereference and create
new Readers object everytime it is called, causing any opened Session with
opened Channel not to be closed properly with SEService.shutdown();
Looking at the logic, it seems like implementation of getReaders is trying to
detect newly added readers while removing those that no longer exist (unlikely
during actual run time in reality). Though, the following code could be
dealing with the need and fixed this issue:
//mReaders.clear(); // this is the issue <<<<<
// new logic to add and remove the list of readers.
Set<String> previousReaderNames = mReaders.keySet();
for (String readerName : readerNames)
{
//Add new plug-in readers
if (!mReaders.containsKey(readerName))
mReaders.put(readerName, new Reader(this, readerName));
}
//Remove not-present readers
List<String> readerNameList = Arrays.asList(readerNames);
for (String preReaderName : preReaderNames)
{
if (!readerNameList.contains(preReaderName))
mReaders.remove(preReaderName);
}
Original comment by etpcc...@gmail.com
on 15 Oct 2014 at 2:39
Original issue reported on code.google.com by
etpcc...@gmail.com
on 5 Sep 2014 at 10:01