You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by "siva (JIRA)" <ji...@apache.org> on 2008/05/20 17:34:56 UTC

[jira] Created: (LOG4NET-156) Probable I/O race condition detected while copying memory.

Probable I/O race condition detected while copying memory. 
-----------------------------------------------------------

                 Key: LOG4NET-156
                 URL: https://issues.apache.org/jira/browse/LOG4NET-156
             Project: Log4net
          Issue Type: Bug
          Components: Appenders
    Affects Versions: 1.2.10
         Environment: Windows XP Professional
            Reporter: siva
             Fix For: 1.2.10


Currently we are facing some issues with the log4net configuration in our project. I am looking for help on this.

We are getting the following error in the log4net log file:

Error: Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader.] 

We are using the rollinglogfileAppender with the rolling style as "Date" and the locking model as "log4net.Appender.FileAppender+MinimalLock".

When nearly 250 users in our application tries to write to the log file it is coming with the above error message.

Any help is greatly appreciated.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (LOG4NET-156) Probable I/O race condition detected while copying memory.

Posted by "Ron Grabowski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LOG4NET-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599183#action_12599183 ] 

Ron Grabowski commented on LOG4NET-156:
---------------------------------------

Use your browser to navigate to this page:
 
 http://www.google.com/

type the following text into the search box that appears:

 log4net mailing lists

then press the button that says:

 I'm Feeling Lucky

You can also visit the log4net home page to find out how to subscribe to the lists.

> Probable I/O race condition detected while copying memory. 
> -----------------------------------------------------------
>
>                 Key: LOG4NET-156
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-156
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.10
>         Environment: Windows XP Professional
>            Reporter: siva
>             Fix For: 1.2.10
>
>
> Currently we are facing some issues with the log4net configuration in our project. I am looking for help on this.
> We are getting the following error in the log4net log file:
> Error: Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader.] 
> We are using the rollinglogfileAppender with the rolling style as "Date" and the locking model as "log4net.Appender.FileAppender+MinimalLock".
> When nearly 250 users in our application tries to write to the log file it is coming with the above error message.
> Any help is greatly appreciated.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (LOG4NET-156) Probable I/O race condition detected while copying memory.

Posted by "Ron Grabowski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LOG4NET-156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ron Grabowski resolved LOG4NET-156.
-----------------------------------

    Resolution: Invalid
      Assignee: Ron Grabowski

The RollingFileAppender/MinimalLock combination most likely won't work with 250+ users....RollingFileAppender/MinimalLock isn't a database! If you must use a RollingFileAppender use a MutextLock instead.

> Probable I/O race condition detected while copying memory. 
> -----------------------------------------------------------
>
>                 Key: LOG4NET-156
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-156
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.10
>         Environment: Windows XP Professional
>            Reporter: siva
>            Assignee: Ron Grabowski
>             Fix For: 1.2.10
>
>
> Currently we are facing some issues with the log4net configuration in our project. I am looking for help on this.
> We are getting the following error in the log4net log file:
> Error: Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader.] 
> We are using the rollinglogfileAppender with the rolling style as "Date" and the locking model as "log4net.Appender.FileAppender+MinimalLock".
> When nearly 250 users in our application tries to write to the log file it is coming with the above error message.
> Any help is greatly appreciated.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (LOG4NET-156) Probable I/O race condition detected while copying memory.

Posted by "siva (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LOG4NET-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12598788#action_12598788 ] 

siva commented on LOG4NET-156:
------------------------------

Any help on this will be greatly appreciated.

Thanks,
Siva



> Probable I/O race condition detected while copying memory. 
> -----------------------------------------------------------
>
>                 Key: LOG4NET-156
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-156
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.10
>         Environment: Windows XP Professional
>            Reporter: siva
>             Fix For: 1.2.10
>
>
> Currently we are facing some issues with the log4net configuration in our project. I am looking for help on this.
> We are getting the following error in the log4net log file:
> Error: Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader.] 
> We are using the rollinglogfileAppender with the rolling style as "Date" and the locking model as "log4net.Appender.FileAppender+MinimalLock".
> When nearly 250 users in our application tries to write to the log file it is coming with the above error message.
> Any help is greatly appreciated.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (LOG4NET-156) Probable I/O race condition detected while copying memory.

Posted by "siva (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LOG4NET-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599013#action_12599013 ] 

siva commented on LOG4NET-156:
------------------------------

Hi Ron,

Thanks for your reply.
Please see the Log4net setting for my application 
<root>
		<level value="INFO"/>
		<appender-ref ref="RollingLogger" />
		<appender-ref ref="EventLogAppender" />
	</root>


<appender name="RollingLogger"
type="log4net.Appender.RollingFileAppender">
		<param name="File"
value="E:\Pages\Health\PrePricingBatch\Logs\" />
		<StaticLogFileName value="false" />
		<lockingModel
type="log4net.Appender.FileAppender+MinimalLock" />
		<appendToFile value="true" />
		<maxSizeRollBackups value="10" />
		<rollingStyle value="Date" />
		<datePattern value="yyyy\_MM\_dd\.\l\o\g" />
		<layout type="log4net.Layout.PatternLayout">
			<conversionPattern value="%d %logger[%t]
%-5level - %m%n" />
		</layout>
</appender>

Since there are many users accessing the application and want to write
the information for each process we used the locking model
"MinimalLock".

Thanks,
Siva



> Probable I/O race condition detected while copying memory. 
> -----------------------------------------------------------
>
>                 Key: LOG4NET-156
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-156
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.10
>         Environment: Windows XP Professional
>            Reporter: siva
>             Fix For: 1.2.10
>
>
> Currently we are facing some issues with the log4net configuration in our project. I am looking for help on this.
> We are getting the following error in the log4net log file:
> Error: Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader.] 
> We are using the rollinglogfileAppender with the rolling style as "Date" and the locking model as "log4net.Appender.FileAppender+MinimalLock".
> When nearly 250 users in our application tries to write to the log file it is coming with the above error message.
> Any help is greatly appreciated.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (LOG4NET-156) Probable I/O race condition detected while copying memory.

Posted by "siva (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LOG4NET-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599086#action_12599086 ] 

siva commented on LOG4NET-156:
------------------------------

Could you please tell me how to take this discussion to mailing lists?

Thanks
Siva



> Probable I/O race condition detected while copying memory. 
> -----------------------------------------------------------
>
>                 Key: LOG4NET-156
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-156
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.10
>         Environment: Windows XP Professional
>            Reporter: siva
>             Fix For: 1.2.10
>
>
> Currently we are facing some issues with the log4net configuration in our project. I am looking for help on this.
> We are getting the following error in the log4net log file:
> Error: Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader.] 
> We are using the rollinglogfileAppender with the rolling style as "Date" and the locking model as "log4net.Appender.FileAppender+MinimalLock".
> When nearly 250 users in our application tries to write to the log file it is coming with the above error message.
> Any help is greatly appreciated.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (LOG4NET-156) Probable I/O race condition detected while copying memory.

Posted by "Ron Grabowski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LOG4NET-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599066#action_12599066 ] 

Ron Grabowski commented on LOG4NET-156:
---------------------------------------

This doesn't look like log4net bug so I'm recommending again that you take this discussion to one of the mailing lists. More people monitor the lists so you might get a faster response from there.

The MinimalLock is very slow compared to the default ExclusiveLock. Its not designed for what you're using it for. Do you have multiple instances of your program trying to write to the same file? With 250 users it sounds like the AdoNetAppender would be a better choice. log4net isn't a database server. Have you tried using the MutexLock that was posted to the log4net-users list a few months ago? That allows multiple processes to write to the same file while still being performant.

I'd recommend against using the RollingFileAppender and the MinimalLock in all but the most basic scenarios (i.e. for single user / single threaded apps its fine).

I'm eventually going to mark this ticket as Invalid.



> Probable I/O race condition detected while copying memory. 
> -----------------------------------------------------------
>
>                 Key: LOG4NET-156
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-156
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.10
>         Environment: Windows XP Professional
>            Reporter: siva
>             Fix For: 1.2.10
>
>
> Currently we are facing some issues with the log4net configuration in our project. I am looking for help on this.
> We are getting the following error in the log4net log file:
> Error: Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader.] 
> We are using the rollinglogfileAppender with the rolling style as "Date" and the locking model as "log4net.Appender.FileAppender+MinimalLock".
> When nearly 250 users in our application tries to write to the log file it is coming with the above error message.
> Any help is greatly appreciated.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (LOG4NET-156) Probable I/O race condition detected while copying memory.

Posted by "Ron Grabowski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LOG4NET-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12598806#action_12598806 ] 

Ron Grabowski commented on LOG4NET-156:
---------------------------------------

The mailing lists are much better places to ask for general help about log4net.

What is your Date pattern for the rolling?

MinimalLock is very slow. Why aren't you using the default ExclusiveLock?

> Probable I/O race condition detected while copying memory. 
> -----------------------------------------------------------
>
>                 Key: LOG4NET-156
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-156
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.10
>         Environment: Windows XP Professional
>            Reporter: siva
>             Fix For: 1.2.10
>
>
> Currently we are facing some issues with the log4net configuration in our project. I am looking for help on this.
> We are getting the following error in the log4net log file:
> Error: Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader.] 
> We are using the rollinglogfileAppender with the rolling style as "Date" and the locking model as "log4net.Appender.FileAppender+MinimalLock".
> When nearly 250 users in our application tries to write to the log file it is coming with the above error message.
> Any help is greatly appreciated.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.