mewna / catnip

A reactive, fully-async Discord API wrapper for the JVM, built on RxJava 3.
https://discord.gg/yeF2HpP
BSD 3-Clause "New" or "Revised" License
151 stars 33 forks source link

ConcurrentHashMap in MemoryEntityCache may block #91

Closed queer closed 5 years ago

queer commented 6 years ago

I got 1 warning when starting ~35 shards of blocking for too long (2 seconds); not sure why since no stacktrace was attached.

queer commented 6 years ago

https://gist.github.com/queer/30c4dd4fc11d95dc23c12429b6090c40

natanbc commented 6 years ago
    at app//com.google.common.collect.ImmutableList.forEach(ImmutableList.java:407)
    at app//com.mewna.catnip.cache.MemoryEntityCache.bulkCacheMembers(MemoryEntityCache.java:376)
    at app//com.mewna.catnip.entity.impl.EntityBuilder.createGuild(EntityBuilder.java:860)
    at app//com.mewna.catnip.entity.impl.EntityBuilder.createGuild(EntityBuilder.java:841)

possibly a large guild with too many members, since this happens on a loop (at app//com.google.common.collect.ImmutableList.forEach)?

queer commented 6 years ago

I can believe that, since we only call it on GUILD_CREATE