[ 
https://issues.apache.org/jira/browse/LOG4NET-677?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17452091#comment-17452091
 ] 

Erik Mavrinac commented on LOG4NET-677:
---------------------------------------

DoAppend() is non-async, calling SqlCommand.ExecuteNonQuery() which is 
non-async. Non-async paths like this do not support newer async and 
cancellation token patterns. To properly support cancellation, log4net would 
need a new async overload DoAppendAsync(..., CancellationToken), along with 
changes across the codebase to add async methods alongside synchronous methods, 
that would allow a cancellation token to be passed from your code down to a SQL 
call to SqlCommand.ExecuteNonQueryAsync(CancellationToken).

This would be a significant update to the log4net code.

> block in multi thread application
> ---------------------------------
>
>                 Key: LOG4NET-677
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-677
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders, Core
>    Affects Versions: 2.0.8
>         Environment: c# .net windows server 2016
>            Reporter: ali
>            Priority: Major
>         Attachments: log4net.png
>
>
> I have application that open about a 1000 thread at same time, but I have 
> mechanism to cancel  all threads with cancellation token. when the 
> application cancel, all log4net threads as appear in a attached picture, 
> blocked and waiting for Sql query on log error method.
> in this function :
> System.Data.dll!System.Data.SqlClient.SqlCommand.ExecuteNonQuery(see pic for 
> more info)
>  
> I want to know if you have any idea about this?



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to