Under Review
Last Updated: 05 Dec 2024 13:35 by ADMIN
Anthony
Created on: 15 Nov 2024 13:34
Category: Map
Type: Bug Report
0
KeyNotFoundException on Dispose in Map control

Hello, I get KeyNotFoundException (ConcurrentDictionary) error in RemoveTile method:

Telerik.Windows.Controls.Map.TilesDownloadManager:

  • private void Dispose() 
  • private void RemoveL1Cache() 
  • private void RemoveTile(TileId key)

I wrote about it here: https://feedback.telerik.com/wpf/1656461-keynotfoundexception-when-zooming-in
But in version 2024.4.1111 only 1 problem was fixed...

ConcurrentDictionary<TileId, TileSource> requests may not contain TileId key in RemoveTile.

Can you fix this in the next release?

10 comments
ADMIN
Petar Mladenov
Posted on: 05 Dec 2024 13:35

Hello Anthony,

We will try to include the fix in a minor version of Telerik UI for WPF on Dec 16th.

Regards,
Petar Mladenov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Anthony
Posted on: 02 Dec 2024 07:07
Hello Petar, Great!
We are currently testing the our build with your dlls. We haven't seen any problems yet.

Because the problem is race condition, it's hard to catch the exception. If the build throws an exception, I'll let you know right away.
ADMIN
Petar Mladenov
Posted on: 28 Nov 2024 14:30

Hello Anthony,

We can try this for mid-December, but it is important that you confirm this works well on your side.

Regards,
Petar Mladenov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Anthony
Posted on: 28 Nov 2024 13:42
thanks, when can we expect a version with fixes in release?
ADMIN
Petar Mladenov
Posted on: 26 Nov 2024 16:41

Hello Anthony,

Generally, this code is being run by multiple threads to boost the performance of the tiles downloading process. This means (and we managed to reproduce it) a possible scenario is:

Line X: this.requests.Containskey(tileID) returns true
Line X+1: this.requests[tileID] - throws KeyNotFouundExpcetion

meaning that a foreign B thread succceeds in removing tileID from the requests colleciton by the time thread A switches from line X to line X+1.
It is certainly our miss, because the ConcurrentDictionry in this case should be used on a single line with TryGetValue() which is a method internally dealing with such concurrency problems. This is the base for our fix candidate I am sending you now.  I hope you will be able to test it and provide some feedback soon.

Regards,
Petar Mladenov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Anthony
Posted on: 26 Nov 2024 08:52

framework 4.6.2

  • Telerik.Windows.Data.dll
  • Telerik.Windows.Controls.dll
  • Telerik.Windows.Controls.DataVisualization.dll

You should add a check for the key existence in "this.requests" (ConcurrentDictionary) in RemoveTile method.
Or find out why the key (TileId) is not in the ConcurrentDictionary

ADMIN
Petar Mladenov
Posted on: 25 Nov 2024 12:05

Hello Anthony,

I forgot to ask you what is the minimum set of dlls (and which framework - 4.6.2/net6/net8) you will need for testing.

Regards,
Petar Mladenov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

ADMIN
Petar Mladenov
Posted on: 25 Nov 2024 12:04

Hi Anthony,

Since this is really hard to reproduce on our side, can we send you a fix candidate version for testing purposes ? Once you agree it is ok at your side, we will be better able to move the fix into some of our next official versions.

Regards,
Petar Mladenov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Anthony
Posted on: 20 Nov 2024 14:31
confirm
Previously there were two cases with an error, now only 1 when disposing
ADMIN
Petar Mladenov
Posted on: 20 Nov 2024 14:10

Hi Anthony,

We will need to investigate this case once again, since we thaught the scenario is resolved by a single change in the UpdateTileCache method.
Could you please confirm the steps you perform in reproducing the exception in RemoveTile() is the same as described before ?
We will contact you here since we have an update from the investigation.

Regards,
Petar Mladenov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.