我正在使用 java sdk:
compile(group: 'com.azure', name: 'azure-cosmos', version: '4.8.0')
在天蓝色的功能。不知道上面的错误是从哪里来的:
您正在创建太多 HashedWheelTimer 实例。HashedWheelTimer 是一个共享资源,必须在 JVM 中重复使用,因此只创建了几个实例。
我正在使用 java sdk:
compile(group: 'com.azure', name: 'azure-cosmos', version: '4.8.0')
在天蓝色的功能。不知道上面的错误是从哪里来的:
您正在创建太多 HashedWheelTimer 实例。HashedWheelTimer 是一个共享资源,必须在 JVM 中重复使用,因此只创建了几个实例。
看,这不是您期望的完整答案-这是尝试提供帮助,也许它会给您提供任何想法,以解决这个非常罕见的错误。
我认为这部分有一个错误:报告ReportTooManyInstances
https://github.com/Azure/DotNetty/blob/4a76e624580e0005257513fce1c69555294763f5/src/DotNetty.Common/Utilities/HashedWheelTimer.cs#L257-L258
static void ReportTooManyInstances() =>
Logger.Error($"You are creating too many {nameof(HashedWheelTimer)} instances.
{nameof(HashedWheelTimer)} is a shared resource that must be reused across the process,so that only a few instances are created.");
InstanceCountLimit = 64
乞讨中
有一个硬代码: https ://github.com/Azure/DotNetty/blob/4a76e624580e0005257513fce1c69555294763f5/src/DotNetty.Common/Utilities/HashedWheelTimer.cs#L19-L27
public sealed class HashedWheelTimer : ITimer
{
static readonly IInternalLogger Logger =
InternalLoggerFactory.GetInstance<HashedWheelTimer>();
static int instanceCounter;
static int warnedTooManyInstances;
const int InstanceCountLimit = 64;
如果你到达InstanceCountLimit
,有一段代码说明ReportTooManyInstances
应该抛出。
if (Interlocked.Increment(ref instanceCounter) > InstanceCountLimit &&
Interlocked.CompareExchange(ref warnedTooManyInstances, 1, 0) == 0)
{
ReportTooManyInstances();
}
我还发现了什么(也许你会感兴趣):