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

-act,fault #50 remove fault handling code and test #51

Merged
merged 6 commits into from
Aug 29, 2019
Merged

-act,fault #50 remove fault handling code and test #51

merged 6 commits into from
Aug 29, 2019

Conversation

ktoso
Copy link
Member

@ktoso ktoso commented Aug 28, 2019

Disable and remove fault handling code.

Resolves #50

Motivation:

We are not sure about shipping the "leaking but surviving" mode, and hope to replace it some day with something serious.

In the meantime ProcessIsolated shall be the way to handle faults. Heavy but more correct and not leaking memory.

We hope to some day get proper support for unwinding in Swift which would enable us to implement this properly, and safely.

Modifications:

  • disable all fault tests
  • remove installing and enabling signal handlers
  • mailbox removes any jump code, which also speeds up execution of the mailbox a bit.

Result:

  • We are not able to survive faults anymore 😞
  • When faults happen, no memory leaks can happen. 👍

The replacement for this mode is the heavy but correct ProcessIsolated mode until we get something better.

@ktoso ktoso requested review from drexin and tomerd August 28, 2019 01:36
case .stop: fatalError("Illegal attempt to interpret message with .stop behavior! Actor should not be acting anymore. Behavior should have been canonicalized. This is a bug, please open a ticket.", file: file, line: line)
case .failed: fatalError("Illegal attempt to interpret message with .failed behavior! Actor should not be acting anymore. Behavior should have been canonicalized. This is a bug, please open a ticket.", file: file, line: line)
case .stop:
return .unhandled
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually seems to happen when we're shutting down the system...
We need to check this independently, but semantics wise it is correct to say unhandled here I think 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't really happen though, right? I'm curious what causes this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it shouldn't; Shutting down may be a bit weird but it still should not happen; I'll make a ticket

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#60

@ktoso ktoso mentioned this pull request Aug 28, 2019
5 tasks
Copy link
Member

@drexin drexin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments. Overall glad we are getting rid of this.

Sources/CDistributedActorsMailbox/c_mailbox.c Show resolved Hide resolved
Sources/CDistributedActorsMailbox/c_mailbox.c Outdated Show resolved Hide resolved
case .stop: fatalError("Illegal attempt to interpret message with .stop behavior! Actor should not be acting anymore. Behavior should have been canonicalized. This is a bug, please open a ticket.", file: file, line: line)
case .failed: fatalError("Illegal attempt to interpret message with .failed behavior! Actor should not be acting anymore. Behavior should have been canonicalized. This is a bug, please open a ticket.", file: file, line: line)
case .stop:
return .unhandled
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't really happen though, right? I'm curious what causes this.

Sources/DistributedActors/Mailbox.swift Outdated Show resolved Hide resolved
Tests/DistributedActorsTests/ActorDeferTests.swift Outdated Show resolved Hide resolved
Tests/DistributedActorsTests/ActorDeferTests.swift Outdated Show resolved Hide resolved
Tests/DistributedActorsTests/ActorDeferTests.swift Outdated Show resolved Hide resolved
Tests/DistributedActorsTests/SupervisionTests.swift Outdated Show resolved Hide resolved
Tests/DistributedActorsTests/SupervisionTests.swift Outdated Show resolved Hide resolved
Tests/DistributedActorsTests/SupervisionTests.swift Outdated Show resolved Hide resolved
@ktoso
Copy link
Member Author

ktoso commented Aug 29, 2019

Ok, this now aggresively removes all fault handling code as well as any tests.

@drexin drexin merged commit 8562681 into apple:master Aug 29, 2019
@ktoso ktoso deleted the wip-remove-fault-handling branch August 29, 2019 04:09
ktoso added a commit that referenced this pull request Aug 31, 2019
* -act,fault #50 remove fault handling code and test

* Remove all Fault handling code

* disable some tests that rely on fault handling

* -act,supervision COMPLETELY remove fault supervision code from mailbox

* More mailbox removals due to lack of fault handling
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

Successfully merging this pull request may close these issues.

Remove fault handling code using signal handling
2 participants