aliyun / aliyun-openapi-net-sdk

Alibaba Cloud SDK for .NET
https://www.nuget.org/profiles/aliyun-openapi-sdk
Other
541 stars 625 forks source link

sdk throws exception System.InvalidOperationException: Operations that change non-concurrent collections must have exclusive access #301

Closed gouhan closed 5 years ago

gouhan commented 5 years ago

the error log we found likes: 2019-08-16 15:59:29.8488|13|ERROR|Microsoft.AspNetCore.Server.Kestrel|Connection id "0HLLSQC4VN2IG", Request id "0HLLSQC4VN2IG:00000001": An unhandled exception was thrown by the application. System.InvalidOperationException: Operations that change non-concurrent collections must have exclusive access. A concurrent update was performed on this collection and corrupted its state. The collection's state is no longer correct. at System.Collections.Generic.Dictionary`2.FindEntry(TKey key) at Aliyun.Acs.Core.Utils.CacheTimeHelper.AddLastClearTimePerProduct(String product, String regionId, DateTime lastClearTime) at Aliyun.Acs.Core.Profile.DefaultProfile.AddEndpoint(String endpointName, String regionId, String product, String domain, Boolean isNeverExpire) at YYB.Api.Common.Controllers.SmsController.Send(String templateId, String phoneNumber, String templateParams) in E:\develop\server\yyb-api-common\YYB.Api.Common\YYB.Api.Common\Controllers\SmsController.cs:line 62

I called the api in the controller's action like : IClientProfile profile = DefaultProfile.GetProfile(Config.RegionId, Config.AccessKeyId, Config.AccessKeySecret); DefaultProfile.AddEndpoint(Config.EndPointName, Config.RegionId, Config.Product, Config.Domain);

gouhan commented 5 years ago

i found the last sdk's version is 1.5.1,has it been fixed now?

gouhan commented 5 years ago

thanks,i found the problem is fixed in the latest version's sdk