>> you should protect the cache no matter what, even the query part. What would >> happen if you are reading the cache while another thread is reading it ? It's the same meaning with what I meant when said, "the LinkedHashMap should be protected since there may be many querying that need to update the cache".
In addition to that, I mentioned the two cases of using the backend APIs to explain why those interface methods are not synchronized. I would add some comments about this later. >> The best is to be sure any of the committers take care of it *before* >> committing. I know it's a tedious task, but less than doing so afterward... I agree. We should add missing docs (not just docs, but also logs!!) for existing codes. We're working on that for the release. For new patches, we should guard if necessary Java docs are there. Regards, Kai -----Original Message----- From: Emmanuel Lécharny [mailto:[email protected]] Sent: Wednesday, July 01, 2015 4:04 PM To: [email protected] Subject: Re: [backend] AbstractIdentityBackend interface Le 01/07/15 09:58, Zheng, Kai a écrit : > Thanks Emmanuel for taking care of this and the comprehensive understanding! > I thought you're all right. > > As I said before, I'm totally OK to redesign and re-implement the cache > support since the original is a quick work and too simple. I thought both > yours or Kiran's are good to me. > > Yes in the existing codes, the LinkedHashMap should be protected since there > may be many querying that need to update the cache. It's my fault not seeing > this. Note most of the methods don't need synchronized because the interface > contains two parts of APIs, one is for KDC which is mainly for querying, the > other is for kadmin that's to add/update/delete entries. No concurrent > threads in kadmin would be used I guess. you should protect the cache no matter what, even the query part. What would happen if you are reading the cache while another thread is reading it ? > > Yes again we need the Javadocs. Recently I'm revisiting some of the codes and > refined quite much. I'm going to revisit them again to add the missing > Javadocs particularly for important APIs. To avoid conflict with Kiran's > effort I'm hesitating on the Identity backend part. The best is to be sure any of the committers take care of it *before* committing. I know it's a tedious task, but less than doing so afterward...
