Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item with ID cannot be deleted because it is not found in Sitecore 9.2+ #402

Open
markgibbons25 opened this issue Feb 20, 2020 · 8 comments

Comments

@markgibbons25
Copy link

We are getting our logs spammed with messages like

WARN Item with ID={C100A1CF-6205-4F05-A636-0831DBADE1D0} cannot be deleted because it is not found

I traced it back to here

I added a log statement

Sitecore.Diagnostics.Log.Info("GLASS DELETE?", this); item.Delete(); //added for clean up

And confirmed logs:

17368 12:51:06 INFO GLASS DELETE?
17368 12:51:06 WARN Item with ID={C100A1CF-6205-4F05-A636-0831DBADE1D0} cannot be deleted because it is not found
17368 12:51:06 INFO GLASS DELETE?
17368 12:51:06 WARN Item with ID={88CC0F4C-EB54-4013-8228-83E558CF35AC} cannot be deleted because it is not found
17368 12:51:06 INFO GLASS DELETE?
17368 12:51:06 WARN Item with ID={B82C7AC0-46BD-4CD5-9D58-E4D9627646E6} cannot be deleted because it is not found
17368 12:51:07 INFO GLASS DELETE?

It looks like Sitecore in 9.2+ has changed that Delete() to log if the item is not found.
Looks like in this case it is an in memory item only.
Is it safe to just remove that item.Delete() line and let the GC do its thing?
Happy to open a PR if so.

@swissworx
Copy link

@mikeedwards83 any thoughts on @markgibbons25 suggestion? We are facing the same problem and this is filling up our prod trace logs massively. Thanks for your help!

@mikeedwards83
Copy link
Owner

@swissworx Sorry for not responding quicker.

This is indeed annoying, my only worry is that the item just hangs around in memory and cause a memory leak if delete isn't called. Is there a way to tell if the item is removed from memory without the delete?

@markgibbons25
Copy link
Author

It looks to me like it is going to get cleaned up by the GC just fine. Which leads me to think that we could maybe improve performance here by pooling and reusing these fake items to save the GC some work.
I'll do some benchmarking...

markgibbons25 pushed a commit to markgibbons25/Glass.Mapper that referenced this issue May 6, 2020
@simonethreechillies
Copy link

Hi @markgibbons25

We've seen the same behaviour in one of our projects. When could we expect this update to be published on NuGet?

Thanks!

@markgibbons25
Copy link
Author

Hi @markgibbons25

We've seen the same behaviour in one of our projects. When could we expect this update to be published on NuGet?

Thanks!

I would love to but it's up to @mikeedwards83

@swissworx
Copy link

@mikeedwards83 it looks fine to me, I quickly cracked the Sitecore dll open and I couldn't find anything being allocated that is not cleaned up by the GC.

@Glass-Build-Github
Copy link
Collaborator

Glass-Build-Github commented May 12, 2020 via email

mikeedwards83 pushed a commit that referenced this issue May 13, 2020
Adds a DeleteRenderingParametersItems flag to allow backward compatibility
@mikeedwards83
Copy link
Owner

I have pushed a beta release with this fix, it also contains a flag in the config for backward compatibility. By default it will no longer delete the item, but setting the flag will restore the original logic.

74ff5e8#diff-112f7122b703ee4f85649982cc0c249eR74

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants