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

ObjectHandle - LifeTime avoid remoting exception: has been disconnected #2910

Merged
merged 1 commit into from
Sep 12, 2018

Conversation

snakefoot
Copy link
Contributor

@snakefoot snakefoot commented Sep 11, 2018

or does not exist at the server. Followup to #2857

The recommendation of using ObjectHandle from David Fowler was a trap.

Instead perform ToString serialization on-demand when changing AppDomain (Deferring the overhead of remoting until actually AppDomain transfer). Avoid funny business with ObjectHandle lifetime management using the AppDomain-Default-LifeTime. Avoid funny business with returning null in InitializeLifetimeService, and abusing the finalizer queue for cleanup.

@codecov
Copy link

codecov bot commented Sep 11, 2018

Codecov Report

❗ No coverage uploaded for pull request base (dev@0029c3d). Click here to learn what that means.
The diff coverage is 73%.

@@          Coverage Diff          @@
##             dev   #2910   +/-   ##
=====================================
  Coverage       ?     80%           
=====================================
  Files          ?     329           
  Lines          ?   24943           
  Branches       ?    3186           
=====================================
  Hits           ?   20041           
  Misses         ?    4029           
  Partials       ?     873

…eption with disconnected or does not exist at the server
@304NotModified 304NotModified added this to the 4.6 milestone Sep 12, 2018
@304NotModified 304NotModified added the enhancement Improvement on existing feature label Sep 12, 2018
@304NotModified
Copy link
Member

👍 thanks!

@304NotModified 304NotModified merged commit dcc3af1 into NLog:dev Sep 12, 2018
@snakefoot
Copy link
Contributor Author

snakefoot commented Sep 12, 2018

Should improve performance (Compare to the ToString-hack in NLog/NLog.Extensions.Logging#232), as it can defer the ToString-operation and Type-checking until actually doing AppDomain-transfer.

But it is not funny to read articles about remoting and AppDomains. So many cries about pitfalls and dead-ends.

snakefoot added a commit to snakefoot/NLog that referenced this pull request Sep 24, 2018
…eption with disconnected or does not exist at the server (NLog#2910)
snakefoot added a commit to snakefoot/NLog that referenced this pull request Nov 4, 2018
…eption with disconnected or does not exist at the server (NLog#2910)
@snakefoot snakefoot mentioned this pull request Jan 14, 2019
@snakefoot snakefoot deleted the ObjectHandleLifeTime branch April 4, 2020 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement on existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants