I have a tomcat application, and currently started just one node, multicast mode I am populating a cache and proceeded to lock the map, but when there is data to put, the application never returns since it is trying to repartition, but there is ONLY one node and no data existed before.
If I do not lock the map, then it works. ICache is a wrapper on the IMap. Most ICache methods are the same as IMap's. ICache.lock(long, TimeUnit) calls IMap.lockMap(long, TimeUnit) This is the code public void replaceSectionSlots(final Map inReplacement) { ICache<String, Set<Positionable>> sectionSlotCache = getYardSectionSlotCache(); // It should not be null. if (sectionSlotCache != null) { boolean locked = false; try { locked = sectionSlotCache.lock(500, TimeUnit.MILLISECONDS); if (locked) { sectionSlotCache.removeAll(); // There is no data; it never returns sectionSlotCache.putAll(inReplacement); // Section Slot observers should be notified LOGGER.debug("replaceSectionSlots"); } } catch (Throwable thr) { LOGGER.error("Could not replace all blocks. Exception: " + thr.getMessage()); } finally { if (locked) { sectionSlotCache.unlock(); } } } }
Hazelcast is not *trying to repartition**. *It is just checking partition
table if there is a need for repartitioning.
What is implementation of ICahce.removeAll()? Does it just call
IMap.clear()?
What is your Hazelcast version? IMap.clear does not call CONCURRENT_MAP_SET
operation but there are several CONCURRENT_MAP_SET calls in log. Are there
other threads processing on this map?
On Thu, May 3, 2012 at 2:38 AM, <gisel...@yachay.net> wrote:
> I have a tomcat application, and currently started just one node,
> multicast mode
> I am populating a cache and proceeded to lock the map, but when there is
> data to put, the application never returns since it is trying to
> repartition, but there is ONLY one node and no data existed before.
> If I do not lock the map, then it works.
> ICache is a wrapper on the IMap. Most ICache methods are the same as
> IMap's. ICache.lock(long, TimeUnit) calls IMap.lockMap(long, TimeUnit)
> This is the code
> public void replaceSectionSlots(final Map inReplacement) {
> ICache<String, Set<Positionable>> sectionSlotCache =
> getYardSectionSlotCache();
> // It should not be null.
> if (sectionSlotCache != null) {
> boolean locked = false;
> try {
> locked = sectionSlotCache.lock(500, TimeUnit.MILLISECONDS);
> if (locked) {
> sectionSlotCache.removeAll();
> // There is no data; it never returns
> sectionSlotCache.putAll(inReplacement);
> // Section Slot observers should be notified
> LOGGER.debug("replaceSectionSlots");
> }
> } catch (Throwable thr) {
> LOGGER.error("Could not replace all blocks. Exception: " +
> thr.getMessage());
> } finally {
> if (locked) {
> sectionSlotCache.unlock();
> }
> }
> }
> }
> --
> You received this message because you are subscribed to the Google Groups
> "Hazelcast" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/hazelcast/-/7IjQGnFKbEsJ.
> To post to this group, send email to hazelcast@googlegroups.com.
> To unsubscribe from this group, send email to
> hazelcast+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/hazelcast?hl=en.
I am using version 2.0.3. ICache.removeAll calls IMap.clear()
public void removeAll() { _cache.clear(); }
There are other threads waiting for a caller of replaceSectionSlots() to finish, but it never comes back. I see the finally never gets called. At the point that this happens, the cache is empty, so clear() should not have found anything.
On Wednesday, May 2, 2012 10:59:38 PM UTC-7, Mehmet Dogan wrote:
> Hazelcast is not *trying to repartition**. *It is just checking partition > table if there is a need for repartitioning.
> What is implementation of ICahce.removeAll()? Does it just call > IMap.clear()?
> What is your Hazelcast version? IMap.clear does not call CONCURRENT_MAP_SET > operation but there are several CONCURRENT_MAP_SET calls in log. Are > there other threads processing on this map?
> @mmdogan
> On Thu, May 3, 2012 at 2:38 AM, <gisel...@yachay.net> wrote:
>> I have a tomcat application, and currently started just one node, >> multicast mode >> I am populating a cache and proceeded to lock the map, but when there is >> data to put, the application never returns since it is trying to >> repartition, but there is ONLY one node and no data existed before.
>> If I do not lock the map, then it works. >> ICache is a wrapper on the IMap. Most ICache methods are the same as >> IMap's. ICache.lock(long, TimeUnit) calls IMap.lockMap(long, TimeUnit) >> This is the code >> public void replaceSectionSlots(final Map inReplacement) { >> ICache<String, Set<Positionable>> sectionSlotCache = >> getYardSectionSlotCache(); >> // It should not be null. >> if (sectionSlotCache != null) { >> boolean locked = false; >> try { >> locked = sectionSlotCache.lock(500, >> TimeUnit.MILLISECONDS); >> if (locked) { >> sectionSlotCache.removeAll(); >> // There is no data; it never returns >> sectionSlotCache.putAll(inReplacement); >> // Section Slot observers should be notified >> LOGGER.debug("replaceSectionSlots"); >> } >> } catch (Throwable thr) { >> LOGGER.error("Could not replace all blocks. Exception: " >> + thr.getMessage()); >> } finally { >> if (locked) { >> sectionSlotCache.unlock(); >> } >> } >> } >> }
>> -- >> You received this message because you are subscribed to the Google Groups >> "Hazelcast" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/hazelcast/-/7IjQGnFKbEsJ. >> To post to this group, send email to hazelcast@googlegroups.com. >> To unsubscribe from this group, send email to >> hazelcast+unsubscribe@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/hazelcast?hl=en.
On Thu, May 3, 2012 at 7:24 PM, <gisel...@yachay.net> wrote:
> I am using version 2.0.3.
> ICache.removeAll calls IMap.clear()
> public void removeAll() {
> _cache.clear();
> }
> There are other threads waiting for a caller of replaceSectionSlots() to
> finish, but it never comes back. I see the finally never gets called.
> At the point that this happens, the cache is empty, so clear() should not
> have found anything.
> On Wednesday, May 2, 2012 10:59:38 PM UTC-7, Mehmet Dogan wrote:
>> Hazelcast is not *trying to repartition**. *It is just checking
>> partition table if there is a need for repartitioning.
>> What is implementation of ICahce.removeAll()? Does it just call
>> IMap.clear()?
>> What is your Hazelcast version? IMap.clear does not call CONCURRENT_MAP_SET
>> operation but there are several CONCURRENT_MAP_SET calls in log. Are
>> there other threads processing on this map?
>> @mmdogan
>> On Thu, May 3, 2012 at 2:38 AM, <gisel...@yachay.net> wrote:
>>> I have a tomcat application, and currently started just one node,
>>> multicast mode
>>> I am populating a cache and proceeded to lock the map, but when there is
>>> data to put, the application never returns since it is trying to
>>> repartition, but there is ONLY one node and no data existed before.
>>> If I do not lock the map, then it works.
>>> ICache is a wrapper on the IMap. Most ICache methods are the same as
>>> IMap's. ICache.lock(long, TimeUnit) calls IMap.lockMap(long, TimeUnit)
>>> This is the code
>>> public void replaceSectionSlots(final Map inReplacement) {
>>> ICache<String, Set<Positionable>> sectionSlotCache =
>>> getYardSectionSlotCache();
>>> // It should not be null.
>>> if (sectionSlotCache != null) {
>>> boolean locked = false;
>>> try {
>>> locked = sectionSlotCache.lock(500,
>>> TimeUnit.MILLISECONDS);
>>> if (locked) {
>>> sectionSlotCache.removeAll(); **
>>> // There is no data; it never returns
>>> sectionSlotCache.putAll(**inReplacement);
>>> // Section Slot observers should be notified
>>> LOGGER.debug("**replaceSectionSlots");
>>> }
>>> } catch (Throwable thr) {
>>> LOGGER.error("Could not replace all blocks. Exception: "
>>> + thr.getMessage());
>>> } finally {
>>> if (locked) {
>>> sectionSlotCache.unlock();
>>> }
>>> }
>>> }
>>> }
> To post to this group, send email to hazelcast@googlegroups.com.
> To unsubscribe from this group, send email to
> hazelcast+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/hazelcast?hl=en.
It is the putAll() that is blocking, sorry. There was no data. So it is trying to add a map with data. I am attaching two files. One with all the thread dumps. The other with some of the threads, end of log, and code snippets with commented line numbers.
The one with all the threads, defaultQuartzScheduler_Worker-15 and ActiveMQ Task-2 threads are waiting for another process with is not used by this application. The first thread,defaultQuartzScheduler_Worker-2, is where hazelcast, never returns, and that piece of code is part of a LOCKed block executed only when the application starts, and only one thread is allowed to enter at a time.
On Friday, May 4, 2012 6:04:11 AM UTC-7, Mehmet Dogan wrote:
> Can you post thread dump of all threads when removeAll call blocks?
> @mmdogan
> On Thu, May 3, 2012 at 7:24 PM, <gisel...@yachay.net> wrote:
>> I am using version 2.0.3. >> ICache.removeAll calls IMap.clear()
>> public void removeAll() { >> _cache.clear(); >> }
>> There are other threads waiting for a caller of replaceSectionSlots() to >> finish, but it never comes back. I see the finally never gets called. >> At the point that this happens, the cache is empty, so clear() should not >> have found anything.
>> On Wednesday, May 2, 2012 10:59:38 PM UTC-7, Mehmet Dogan wrote:
>>> Hazelcast is not *trying to repartition**. *It is just checking >>> partition table if there is a need for repartitioning.
>>> What is implementation of ICahce.removeAll()? Does it just call >>> IMap.clear()?
>>> What is your Hazelcast version? IMap.clear does not call CONCURRENT_MAP_SET >>> operation but there are several CONCURRENT_MAP_SET calls in log. Are >>> there other threads processing on this map?
>>> @mmdogan
>>> On Thu, May 3, 2012 at 2:38 AM, <gisel...@yachay.net> wrote:
>>>> I have a tomcat application, and currently started just one node, >>>> multicast mode >>>> I am populating a cache and proceeded to lock the map, but when there >>>> is data to put, the application never returns since it is trying to >>>> repartition, but there is ONLY one node and no data existed before.
>>>> If I do not lock the map, then it works. >>>> ICache is a wrapper on the IMap. Most ICache methods are the same as >>>> IMap's. ICache.lock(long, TimeUnit) calls IMap.lockMap(long, TimeUnit) >>>> This is the code >>>> public void replaceSectionSlots(final Map inReplacement) { >>>> ICache<String, Set<Positionable>> sectionSlotCache = >>>> getYardSectionSlotCache(); >>>> // It should not be null. >>>> if (sectionSlotCache != null) { >>>> boolean locked = false; >>>> try { >>>> locked = sectionSlotCache.lock(500, >>>> TimeUnit.MILLISECONDS); >>>> if (locked) { >>>> sectionSlotCache.removeAll(); ** >>>> // There is no data; it never returns >>>> sectionSlotCache.putAll(**inReplacement); >>>> // Section Slot observers should be notified >>>> LOGGER.debug("**replaceSectionSlots"); >>>> } >>>> } catch (Throwable thr) { >>>> LOGGER.error("Could not replace all blocks. Exception: >>>> " + thr.getMessage()); >>>> } finally { >>>> if (locked) { >>>> sectionSlotCache.unlock(); >>>> } >>>> } >>>> } >>>> }
>>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Hazelcast" group. >>>> To view this discussion on the web visit https://groups.google.com/d/** >>>> msg/hazelcast/-/7IjQGnFKbEsJ<https://groups.google.com/d/msg/hazelcast/-/7IjQGnFKbEsJ> >>>> . >>>> To post to this group, send email to hazelcast@googlegroups.com. >>>> To unsubscribe from this group, send email to hazelcast+unsubscribe@** >>>> googlegroups.com <hazelcast%2Bunsubscribe@googlegroups.com>. >>>> For more options, visit this group at http://groups.google.com/** >>>> group/hazelcast?hl=en <http://groups.google.com/group/hazelcast?hl=en>.
>> To post to this group, send email to hazelcast@googlegroups.com. >> To unsubscribe from this group, send email to >> hazelcast+unsubscribe@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/hazelcast?hl=en.
Oh, how I didn't realize! IMap.putAll() uses executor threads for put
operations, that optimizes puts due to target nodes. And because map is
locked by caller thread, executor threads processing putAll() sub-tasks are
blocked. Locking the whole map and doing putAll is cause of deadlock.
Actually locking whole map (without key) is not a preferred way, because it
actually freezes map and blocks all other operations. Maybe you should use
a separate lock for that task.
On Sat, May 5, 2012 at 2:25 AM, <gisel...@yachay.net> wrote:
> It is the putAll() that is blocking, sorry. There was no data. So it is
> trying to add a map with data.
> I am attaching two files. One with all the thread dumps. The other with
> some of the threads, end of log, and code snippets with commented line
> numbers.
> The one with all the threads, defaultQuartzScheduler_Worker-15 and
> ActiveMQ Task-2 threads are waiting for another process with is not used by
> this application.
> The first thread,defaultQuartzScheduler_Worker-2, is where hazelcast,
> never returns, and that piece of code is part of a LOCKed block executed
> only when the application starts, and only one thread is allowed to enter
> at a time.
> On Friday, May 4, 2012 6:04:11 AM UTC-7, Mehmet Dogan wrote:
>> Can you post thread dump of all threads when removeAll call blocks?
>> @mmdogan
>> On Thu, May 3, 2012 at 7:24 PM, <gisel...@yachay.net> wrote:
>>> I am using version 2.0.3.
>>> ICache.removeAll calls IMap.clear()
>>> public void removeAll() {
>>> _cache.clear();
>>> }
>>> There are other threads waiting for a caller of replaceSectionSlots() to
>>> finish, but it never comes back. I see the finally never gets called.
>>> At the point that this happens, the cache is empty, so clear() should
>>> not have found anything.
>>> On Wednesday, May 2, 2012 10:59:38 PM UTC-7, Mehmet Dogan wrote:
>>>> Hazelcast is not *trying to repartition**. *It is just checking
>>>> partition table if there is a need for repartitioning.
>>>> What is implementation of ICahce.removeAll()? Does it just call
>>>> IMap.clear()?
>>>> What is your Hazelcast version? IMap.clear does not call CONCURRENT_MAP_SET
>>>> operation but there are several CONCURRENT_MAP_SET calls in log. Are
>>>> there other threads processing on this map?
>>>> @mmdogan
>>>> On Thu, May 3, 2012 at 2:38 AM, <gisel...@yachay.net> wrote:
>>>>> I have a tomcat application, and currently started just one node,
>>>>> multicast mode
>>>>> I am populating a cache and proceeded to lock the map, but when there
>>>>> is data to put, the application never returns since it is trying to
>>>>> repartition, but there is ONLY one node and no data existed before.
>>>>> If I do not lock the map, then it works.
>>>>> ICache is a wrapper on the IMap. Most ICache methods are the same as
>>>>> IMap's. ICache.lock(long, TimeUnit) calls IMap.lockMap(long, TimeUnit)
>>>>> This is the code
>>>>> public void replaceSectionSlots(final Map inReplacement) {
>>>>> ICache<String, Set<Positionable>> sectionSlotCache =
>>>>> getYardSectionSlotCache();
>>>>> // It should not be null.
>>>>> if (sectionSlotCache != null) {
>>>>> boolean locked = false;
>>>>> try {
>>>>> locked = sectionSlotCache.lock(500,
>>>>> TimeUnit.MILLISECONDS);
>>>>> if (locked) {
>>>>> sectionSlotCache.removeAll(); ****
>>>>> // There is no data; it never returns
>>>>> sectionSlotCache.putAll(**inRepl**acement);
>>>>> // Section Slot observers should be notified
>>>>> LOGGER.debug("**replaceSectionSl**ots");
>>>>> }
>>>>> } catch (Throwable thr) {
>>>>> LOGGER.error("Could not replace all blocks. Exception:
>>>>> " + thr.getMessage());
>>>>> } finally {
>>>>> if (locked) {
>>>>> sectionSlotCache.unlock();
>>>>> }
>>>>> }
>>>>> }
>>>>> }
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Hazelcast" group.
>>>>> To view this discussion on the web visit https://groups.google.com/d/* >>>>> *ms**g/hazelcast/-/7IjQGnFKbEsJ<https://groups.google.com/d/msg/hazelcast/-/7IjQGnFKbEsJ>
>>>>> .
>>>>> To post to this group, send email to hazelcast@googlegroups.com.
>>>>> To unsubscribe from this group, send email to hazelcast+unsubscribe@**
>>>>> googlegr**oups.com <hazelcast%2Bunsubscribe@googlegroups.com>.
>>>>> For more options, visit this group at http://groups.google.com/**group >>>>> **/hazelcast?hl=en <http://groups.google.com/group/hazelcast?hl=en>.
>>> To post to this group, send email to hazelcast@googlegroups.com.
>>> To unsubscribe from this group, send email to hazelcast+unsubscribe@**
>>> googlegroups.com <hazelcast%2Bunsubscribe@googlegroups.com>.
>>> For more options, visit this group at http://groups.google.com/** >>> group/hazelcast?hl=en <http://groups.google.com/group/hazelcast?hl=en>.
> To post to this group, send email to hazelcast@googlegroups.com.
> To unsubscribe from this group, send email to
> hazelcast+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/hazelcast?hl=en.
On Saturday, May 5, 2012 1:12:57 AM UTC-7, Mehmet Dogan wrote:
> Oh, how I didn't realize! IMap.putAll() uses executor threads for put > operations, that optimizes puts due to target nodes. And because map is > locked by caller thread, executor threads processing putAll() sub-tasks are > blocked. Locking the whole map and doing putAll is cause of deadlock.
> Actually locking whole map (without key) is not a preferred way, because > it actually freezes map and blocks all other operations. Maybe you should > use a separate lock for that task.
> @mmdogan
> On Sat, May 5, 2012 at 2:25 AM, <gisel...@yachay.net> wrote:
>> It is the putAll() that is blocking, sorry. There was no data. So it is >> trying to add a map with data. >> I am attaching two files. One with all the thread dumps. The other with >> some of the threads, end of log, and code snippets with commented line >> numbers.
>> The one with all the threads, defaultQuartzScheduler_Worker-15 and >> ActiveMQ Task-2 threads are waiting for another process with is not used by >> this application. >> The first thread,defaultQuartzScheduler_Worker-2, is where hazelcast, >> never returns, and that piece of code is part of a LOCKed block executed >> only when the application starts, and only one thread is allowed to enter >> at a time.
>> On Friday, May 4, 2012 6:04:11 AM UTC-7, Mehmet Dogan wrote:
>>> Can you post thread dump of all threads when removeAll call blocks?
>>> @mmdogan
>>> On Thu, May 3, 2012 at 7:24 PM, <gisel...@yachay.net> wrote:
>>>> I am using version 2.0.3. >>>> ICache.removeAll calls IMap.clear()
>>>> public void removeAll() { >>>> _cache.clear(); >>>> }
>>>> There are other threads waiting for a caller of replaceSectionSlots() >>>> to finish, but it never comes back. I see the finally never gets called. >>>> At the point that this happens, the cache is empty, so clear() should >>>> not have found anything.
>>>> On Wednesday, May 2, 2012 10:59:38 PM UTC-7, Mehmet Dogan wrote:
>>>>> Hazelcast is not *trying to repartition**. *It is just checking >>>>> partition table if there is a need for repartitioning.
>>>>> What is implementation of ICahce.removeAll()? Does it just call >>>>> IMap.clear()?
>>>>> What is your Hazelcast version? IMap.clear does not call CONCURRENT_MAP_SET >>>>> operation but there are several CONCURRENT_MAP_SET calls in log. Are >>>>> there other threads processing on this map?
>>>>> @mmdogan
>>>>> On Thu, May 3, 2012 at 2:38 AM, <gisel...@yachay.net> wrote:
>>>>>> I have a tomcat application, and currently started just one node, >>>>>> multicast mode >>>>>> I am populating a cache and proceeded to lock the map, but when there >>>>>> is data to put, the application never returns since it is trying to >>>>>> repartition, but there is ONLY one node and no data existed before.
>>>>>> If I do not lock the map, then it works. >>>>>> ICache is a wrapper on the IMap. Most ICache methods are the same as >>>>>> IMap's. ICache.lock(long, TimeUnit) calls IMap.lockMap(long, TimeUnit) >>>>>> This is the code >>>>>> public void replaceSectionSlots(final Map inReplacement) { >>>>>> ICache<String, Set<Positionable>> sectionSlotCache = >>>>>> getYardSectionSlotCache(); >>>>>> // It should not be null. >>>>>> if (sectionSlotCache != null) { >>>>>> boolean locked = false; >>>>>> try { >>>>>> locked = sectionSlotCache.lock(500, >>>>>> TimeUnit.MILLISECONDS); >>>>>> if (locked) { >>>>>> sectionSlotCache.removeAll(); **** >>>>>> // There is no data; it never returns >>>>>> sectionSlotCache.putAll(**inRepl**acement); >>>>>> // Section Slot observers should be notified >>>>>> LOGGER.debug("**replaceSectionSl**ots"); >>>>>> } >>>>>> } catch (Throwable thr) { >>>>>> LOGGER.error("Could not replace all blocks. >>>>>> Exception: " + thr.getMessage()); >>>>>> } finally { >>>>>> if (locked) { >>>>>> sectionSlotCache.unlock(); >>>>>> } >>>>>> } >>>>>> } >>>>>> }
>>>>>> -- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "Hazelcast" group. >>>>>> To view this discussion on the web visit https://groups.google.com/d/ >>>>>> **ms**g/hazelcast/-/7IjQGnFKbEsJ<https://groups.google.com/d/msg/hazelcast/-/7IjQGnFKbEsJ> >>>>>> . >>>>>> To post to this group, send email to hazelcast@googlegroups.com. >>>>>> To unsubscribe from this group, send email to hazelcast+unsubscribe@* >>>>>> *googlegr**oups.com <hazelcast%2Bunsubscribe@googlegroups.com>. >>>>>> For more options, visit this group at http://groups.google.com/** >>>>>> group**/hazelcast?hl=en<http://groups.google.com/group/hazelcast?hl=en> >>>>>> .
>>>> To post to this group, send email to hazelcast@googlegroups.com. >>>> To unsubscribe from this group, send email to hazelcast+unsubscribe@** >>>> googlegroups.com <hazelcast%2Bunsubscribe@googlegroups.com>. >>>> For more options, visit this group at http://groups.google.com/** >>>> group/hazelcast?hl=en <http://groups.google.com/group/hazelcast?hl=en>.
>> To post to this group, send email to hazelcast@googlegroups.com. >> To unsubscribe from this group, send email to >> hazelcast+unsubscribe@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/hazelcast?hl=en.
You should avoid using IMap.lockMap(), as said before it just freezes map.
Single target operations are safe to use with locking the whole map.
Multi-target operations are executed through a thread-pool and they will be
blocked because of lock.
On Mon, May 7, 2012 at 9:11 PM, <gisel...@yachay.net> wrote:
> So, what are we allowed to do when we lock the whole cache? so that we do
> not run into these deadlocks?
> On Saturday, May 5, 2012 1:12:57 AM UTC-7, Mehmet Dogan wrote:
>> Oh, how I didn't realize! IMap.putAll() uses executor threads for put
>> operations, that optimizes puts due to target nodes. And because map is
>> locked by caller thread, executor threads processing putAll() sub-tasks are
>> blocked. Locking the whole map and doing putAll is cause of deadlock.
>> Actually locking whole map (without key) is not a preferred way, because
>> it actually freezes map and blocks all other operations. Maybe you should
>> use a separate lock for that task.
>> @mmdogan
>> On Sat, May 5, 2012 at 2:25 AM, <gisel...@yachay.net> wrote:
>>> It is the putAll() that is blocking, sorry. There was no data. So it is
>>> trying to add a map with data.
>>> I am attaching two files. One with all the thread dumps. The other with
>>> some of the threads, end of log, and code snippets with commented line
>>> numbers.
>>> The one with all the threads, defaultQuartzScheduler_Worker-**15 and
>>> ActiveMQ Task-2 threads are waiting for another process with is not used by
>>> this application.
>>> The first thread,defaultQuartzScheduler_**Worker-2, is where hazelcast,
>>> never returns, and that piece of code is part of a LOCKed block executed
>>> only when the application starts, and only one thread is allowed to enter
>>> at a time.
>>> On Friday, May 4, 2012 6:04:11 AM UTC-7, Mehmet Dogan wrote:
>>>> Can you post thread dump of all threads when removeAll call blocks?
>>>> @mmdogan
>>>> On Thu, May 3, 2012 at 7:24 PM, <gisel...@yachay.net> wrote:
>>>>> I am using version 2.0.3.
>>>>> ICache.removeAll calls IMap.clear()
>>>>> public void removeAll() {
>>>>> _cache.clear();
>>>>> }
>>>>> There are other threads waiting for a caller of replaceSectionSlots()
>>>>> to finish, but it never comes back. I see the finally never gets called.
>>>>> At the point that this happens, the cache is empty, so clear() should
>>>>> not have found anything.
>>>>> On Wednesday, May 2, 2012 10:59:38 PM UTC-7, Mehmet Dogan wrote:
>>>>>> Hazelcast is not *trying to repartition**. *It is just checking
>>>>>> partition table if there is a need for repartitioning.
>>>>>> What is implementation of ICahce.removeAll()? Does it just call
>>>>>> IMap.clear()?
>>>>>> What is your Hazelcast version? IMap.clear does not call CONCURRENT_MAP_SET
>>>>>> operation but there are several CONCURRENT_MAP_SET calls in log. Are
>>>>>> there other threads processing on this map?
>>>>>> @mmdogan
>>>>>> On Thu, May 3, 2012 at 2:38 AM, <gisel...@yachay.net> wrote:
>>>>>>> I have a tomcat application, and currently started just one node,
>>>>>>> multicast mode
>>>>>>> I am populating a cache and proceeded to lock the map, but when
>>>>>>> there is data to put, the application never returns since it is trying to
>>>>>>> repartition, but there is ONLY one node and no data existed before.
>>>>>>> If I do not lock the map, then it works.
>>>>>>> ICache is a wrapper on the IMap. Most ICache methods are the same as
>>>>>>> IMap's. ICache.lock(long, TimeUnit) calls IMap.lockMap(long, TimeUnit)
>>>>>>> This is the code
>>>>>>> public void replaceSectionSlots(final Map inReplacement) {
>>>>>>> ICache<String, Set<Positionable>> sectionSlotCache =
>>>>>>> getYardSectionSlotCache();
>>>>>>> // It should not be null.
>>>>>>> if (sectionSlotCache != null) {
>>>>>>> boolean locked = false;
>>>>>>> try {
>>>>>>> locked = sectionSlotCache.lock(500,
>>>>>>> TimeUnit.MILLISECONDS);
>>>>>>> if (locked) {
>>>>>>> sectionSlotCache.removeAll(); ******
>>>>>>> // There is no data; it never returns
>>>>>>> sectionSlotCache.putAll(**inRepl****acement);
>>>>>>> // Section Slot observers should be notified
>>>>>>> LOGGER.debug("**replaceSectionSl****ots");
>>>>>>> }
>>>>>>> } catch (Throwable thr) {
>>>>>>> LOGGER.error("Could not replace all blocks.
>>>>>>> Exception: " + thr.getMessage());
>>>>>>> } finally {
>>>>>>> if (locked) {
>>>>>>> sectionSlotCache.unlock();
>>>>>>> }
>>>>>>> }
>>>>>>> }
>>>>>>> }
>>>>> To post to this group, send email to hazelcast@googlegroups.com.
>>>>> To unsubscribe from this group, send email to hazelcast+unsubscribe@**
>>>>> googlegr**oups.com <hazelcast%2Bunsubscribe@googlegroups.com>.
>>>>> For more options, visit this group at http://groups.google.com/**group >>>>> **/hazelcast?hl=en <http://groups.google.com/group/hazelcast?hl=en>.
>>> To post to this group, send email to hazelcast@googlegroups.com.
>>> To unsubscribe from this group, send email to hazelcast+unsubscribe@**
>>> googlegroups.com <hazelcast%2Bunsubscribe@googlegroups.com>.
>>> For more options, visit this group at http://groups.google.com/** >>> group/hazelcast?hl=en <http://groups.google.com/group/hazelcast?hl=en>.
> To post to this group, send email to hazelcast@googlegroups.com.
> To unsubscribe from this group, send email to
> hazelcast+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/hazelcast?hl=en.