Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Charts Crashing: Write lock may not be acquired with read lock held.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #46
    I am using 8.0.26.1 with Ninza Renko bars on AT LEAST 10 charts... I routinely have 15+ charts running... These are FAST charts as well... lots of rendering and lots of bars... That doesn't include the multitude of 3rd party indicators running as well... This is a production machine I use for day trading... NEVER an issue...

    Besides trading, I help to support the 8.1.X.X platform through a 3rd party... On certain days, it's a virtual nightmare... The "issue" can easily be tracked to the database conversion between 8.0.26.X and 8.0.27.X and above... There are no mysteries... It's THERE that all the problems started...

    Comment


      #47
      Originally posted by RedRock View Post
      Welp... Me Too Even upgraded my hardware and was looking for instructions to moving to a new machine, then found this thread. Usually have a position on it seems ninza renko bars freezes, other things semi active. Have to ctrl alt del and kill all ninjatrader processes before can restart. ib kinetick log file shows nothing useful 8 1 2 0 64
      SO far today on improved HDW with latest version, no crashes. BUT, seems like it's only a matter on time. We shall see...

      Comment


        #48
        And, Another crash requiring terminating everything. NT. WTF
        Attached Files
        Last edited by RedRock; 11-30-2023, 02:48 PM.

        Comment


          #49
          Is there a list of common coding mistakes that can cause this error?

          Other than the Multi-Threading Consideration for NinjaScript


          And NinjaScript Best Practices?


          Or a list of external problems such as computer capabilities or internet connection.

          I have a customer that is experiencing this problem on 2 different computers. We have tried everything from deleting and creating new workspace to even doing a fresh reset of Ninja.
          Problem seems to persist.
          However, there are hundreds of daily users using this same product and this one seems to be an isolated incident.
          • I don't use OnRender() and always use ChartControl.Dispatcher.InvokeAsync
          • Only thing is that we mainly use NinZaRenko / Uni-Renko charts which seem to be a common factor with a lot of people experiencing this problem.

          I'm just trying to isolate any potential problems and narrow down where it could be. It just seems to happen completely random and I haven't been able to reproduce anything that could cause this in my code.

          I see that in a previous post there is someone looking into it. Have there been any developments regarding this? I appreciate any further insight you may have!
          Thanks!
          TradeSaber Inc.NinjaTrader Ecosystem Vendor - TradeSaber Inc.

          Comment


            #50
            90% of the bugs and problems I have with Ninjatrader has to do with using non timebased charts such as Ninzarenko and Unirenko. I'm somehow not surprised that I found this post informing it has to do with the NT versions. Brushes were set in OnStateChange and everything was correctly called on.

            Well, I can confirm that after downgrading with the help of the link provided by KevinEnergy. I too don't have these crashes anymore. It was causing problems up to the point of not being able to trade with the indicators I made for my client. I'm seriously so fed up with this overrated platform by now.

            Comment


              #51
              Originally posted by Borgen View Post
              90% of the bugs and problems I have with Ninjatrader has to do with using non timebased charts such as Ninzarenko and Unirenko. I'm somehow not surprised that I found this post informing it has to do with the NT versions. Brushes were set in OnStateChange and everything was correctly called on.

              Well, I can confirm that after downgrading with the help of the link provided by KevinEnergy. I too don't have these crashes anymore. It was causing problems up to the point of not being able to trade with the indicators I made for my client. I'm seriously so fed up with this overrated platform by now.
              Same here re rollback. Hopefully the NT Team will address this expediently.

              Comment


                #52
                Originally posted by NinjaTrader_RyanS View Post
                Hello all,

                I am working with our development team to look into what changes were made between R26 and R27 that could possibly exacerbate this issue. I will update this thread when I have more information.
                Thank You Ryan. Please keep us updated. Any news? I can confirm the issue is not present in 8.0.26.1 64-bit

                Comment


                  #53
                  IceTrader? Maybe that is a more fitting product name since freezing charts in a trading platform is a big critical thing. It costs people money.
                  Ninjatrader has a bad habit of doing this for a long time now either with data loading or this locked thread bug. If this isn't considered a high priority bug, then I don't understand how their developers and project managers work. Things that causes users to not be able to use the product as it is meant AND lose money because of it, is a recipe for disaster that can drive people away from your product for good.

                  Comment


                    #54
                    Originally posted by kevinenergy View Post
                    For me, I don't use NinzaRenko.... I don't think the answer lies there. I was not able to trace the issue to any specific indicator.

                    Does the issue happen in Safe mode? No.. and you would not expect it to. The error is caused by two or more threads competing for the same resource. Read locks can be held by multiple threads simultaneously, only for reading. Write locks are exclusive, and can only be held by one thread at a time. The error is caused by a thread trying to obtain a write lock when other threads are currently reading.

                    How would this scenario manifest itself? Well firstly you need multiple threads that are trying to access the same shared resource. Secondly, those threads need to be doing some kind of work causing them to take longer to finish their task meaning they onto their locks for longer.

                    The probability of the issue manifesting in a "Safe Mode" instance of Ninjatrader is slim, because there isn't much work being done. Therefore threads aren't holding locks for very long. Furthermore, users do not use Ninjatrader in Safe Mode, so this is not a realistic test.

                    You need to throw up multiple charts, thereby creating lots of threads. Then add lots of indicators, causing all those threads to do lots of work. All those threads are competing for the same resource and the issue will happen eventually.

                    Furthermore, the majority of the stock Ninjatrader indicators are extremely simple. They don't need to do much work. So you're unlikely to get the issue with the stock indicators either.

                    Just because the issue only manifests when using third-party code doesn't mean that the third-party code is the problem. Its more likely that the third-party code is stressing the platform more, causing more work and causing the problem.

                    The issue doesn't occur in 8.0.26.1 and it does occur in all versions subsequent to this.

                    you need to test the platform the way the users use it. In fact you need to stress-test it. Throw every third-party indicator you can get your hands on onto a chart. The more rendering (work) the better. Tens of thousands of bars. Lots of aggressive UI interaction. Get the platform to crash and then try the same again on 8.0.26.1 and prove it doesn't crash.

                    8.0.26.1 is rock solid. that's why I'm still using it. You'll never make it crash.

                    The "Write lock may not be acquired with read lock held" occurs AFTER the chart has frozen, when user attempts to close the tab / chart / the whole application.

                    Example: the chart has been frozen for 8 minutes from 12:41 to 12:49 before user attempted to close, triggering the "Write lock" exception.

                    2023-12-05 12:41:29:008|1|16|MNQ ninZaRenko 34/5 aomManualStrategy: reDrawZone: Thread 19: we have 2874 including the new one
                    2023-12-05 12:49:43:988|3|16|MNQ ninZaRenko 34/5 aomManualStrategy: OnRender: Thread 19 we have 2876 drawing objects
                    2023-12-05 12:49:49:341|1|4|Workspace AM_DayTrading not saved
                    2023-12-05 12:49:49:465|0|4|Unhandled exception: Write lock may not be acquired with read lock held. This pattern is prone to deadlocks. Please ensure that read locks are released before taking a write lock. If an upgrade is necessary, use an upgrade lock in place of the read lock.


                    The following almost 100% guarantees a freeze:

                    - NQ or MNQ as the instrument (fast ticking)
                    - NinzaRenko bars
                    - at least two tabs, for example, 21/5 and 8/2. Numbers should be relatively small so that new bars form on the chart often
                    - an indicator that creates some drawing objects base on the price action (for example, rectangles showing consolidation areas or lines showing supports and resistances)
                    Last edited by LeonK; 12-25-2023, 08:20 PM.

                    Comment


                      #55
                      Has there been any update or progress on this? My charts are freezing more frequently now than ever. This Write lock error occurred four or five times yesterday, and three more times today. Ninjatrader is becoming unusable as a trading platform. Is my only option to roll back to a prior version? The problem is I have had this issue occur in prior versions as well - but it now seems to be occurring more than ever.

                      Comment


                        #56
                        Hello,

                        Our development/QA team has determined this is caused by underlying issues with add on scripts running in a workspace. Since they cannot reproduce this issue in a native environment of NinjaTrader they are unable to look into the cause further.

                        As mentioned, we recommend isolating which script causes the issue and either debugging the script or reaching out to the developer to look into further.

                        Comment


                          #57
                          NinjaTrader should gather several 3rd party indicators and start testing until they find the problem. If all Ninja is offering is out of the box indicators and standard support for standard candlestick most of us can get that anywhere. Please dont let the trader community down on this widespread issue.

                          Comment


                            #58
                            @NinjaTrader_RyanS​​ Well that is very disappointing. NT is discounting the fact that no one single indicator has ever been found to be the problem, by any of us reporting this issue. Even after considerable effort and time spent trying to follow this advice, you are leaving us right back where we were when this issue was first reported almost a year ago. No resolution, no guidance as to how to identify the problem, or where to look. It does not throw any error visible to us; nothing in the platform points us in a direction to troubleshoot, and following your suggestion to test individual indicators has proved fruitless.

                            Comment


                              #59
                              I seriously doubt that people start experience the same bug out of the blue only because of faulty indicators. It's not a coincidence.
                              Last edited by Leeroy_Jenkins; 01-08-2024, 02:22 PM.

                              Comment


                                #60
                                Originally posted by Leeroy_Jenkins View Post
                                I seriously doubt that all people suddenly start using particular addon and experience the same bug out of the blue. It's not a coincidence.
                                I don't think all addons are having this problem, but maybe all the addons that are having this problem are being made by the same set of developers/consultants

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by argusthome, 03-08-2026, 10:06 AM
                                0 responses
                                80 views
                                0 likes
                                Last Post argusthome  
                                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                                0 responses
                                46 views
                                0 likes
                                Last Post NabilKhattabi  
                                Started by Deep42, 03-06-2026, 12:28 AM
                                0 responses
                                29 views
                                0 likes
                                Last Post Deep42
                                by Deep42
                                 
                                Started by TheRealMorford, 03-05-2026, 06:15 PM
                                0 responses
                                32 views
                                0 likes
                                Last Post TheRealMorford  
                                Started by Mindset, 02-28-2026, 06:16 AM
                                0 responses
                                66 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Working...
                                X