Description
We are using Confluent Schema Registry for our business since two years. Before two weeks, suddenly issues started to appear while producing messages to topics. We are using CachedSchemaRegistryClient to check the message compatibility before producing it.
Below is the code we are using:
`var schemaRegistryApiKey = "<api_key_value>";
var schemaRegistryApiSecret = "<api_secret_value>";
var schemaRegistryConfig = new SchemaRegistryConfig
{
Url = "<schema_registry_url>",
BasicAuthCredentialsSource = AuthCredentialsSource.UserInfo,
BasicAuthUserInfo = $"{schemaRegistryApiKey }:{schemaRegistryApiSecret }"
};
_schemaRegistryClient = new CachedSchemaRegistryClient(schemaRegistryConfig);
var subject = "<subject_name>";
var isCompatible = await _schemaRegistryClient.IsCompatibleAsync(subject, new Schema(message.Schema.ToString(), SchemaType.Avro));
`
When IsCompatible method is called it is taking long time then returning the below error:
System.Threading.Tasks.TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 30 seconds elapsing.
---> System.TimeoutException: The operation was canceled.
---> System.Threading.Tasks.TaskCanceledException: The operation was canceled.
---> System.IO.IOException: Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request..
---> System.Net.Sockets.SocketException (995): The I/O operation has been aborted because of either a thread exit or an application request.
--- End of inner exception stack trace ---
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16 token)
at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](TIOAdapter adapter)
at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](TIOAdapter adapter, Memory1 buffer) at System.Net.Http.HttpConnection.InitialFillAsync(Boolean async) at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) --- End of inner exception stack trace --- at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken) --- End of inner exception stack trace --- --- End of inner exception stack trace --- at System.Net.Http.HttpClient.HandleFailure(Exception e, Boolean telemetryStarted, HttpResponseMessage response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts) at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken) at Confluent.SchemaRegistry.RestService.SendRequest(HttpClient client, Func
1 createRequest)
at Confluent.SchemaRegistry.RestService.ExecuteOnOneInstanceAsync(Func`1 createRequest)
at Confluent.SchemaRegistry.RestService.RequestAsync[T](String endPoint, HttpMethod method, Object[] jsonBody)
at Confluent.SchemaRegistry.RestService.TestLatestCompatibilityAsync(String subject, Schema schema)
at Confluent.SchemaRegistry.CachedSchemaRegistryClient.IsCompatibleAsync(String subject, Schema schema)
Please, any advice is appreciated this issue is stopping our business totally.