Corda is an open source blockchain project, designed for business from the start. Only Corda allows you to build interoperable blockchain networks that transact in strict privacy. Corda's smart contract technology allows businesses to transact directly, with value.
Go to file
Dan Newton c79ad972d0 ENT-6142 Flows become dead due to uncaught exceptions (#4158)
If a flow fails outside of its normal error processing code path it will
end up in `FlowDefaultUncaughtExceptionHandler`.

This handler will put the flow into overnight observation if possible.
This is done in-memory and the database.

Even with this being done, the fiber itself has blown up and therefore
does not manage to get to `SMM.removeFlow` which is where
`SMM.decrementLiveFibers` is called. For example, a flow that errored
will hit this code eventually. This code is also hit when a flow is
suspended and a shutdown event is sent to it.

The `liveFibers` latch blocks the SMM from shutting down until all flows
have finished or processed shutdown events.

The changes described below resolve this problem.

Any flow that goes to the `FlowDefaultUncaughtExceptionHandler` will be
put marked as dead (`StateMachineState.isDead`). Highlighting that the
flow cannot continue to process events normally as it has broken out
of its event loop

Retrying and shutdown are done manually rather than injecting events
into the flow fiber's queue, because it can't execute its event loop.

Killing a dead flow executes an altered version of
`retryFlowFromSafePoint`. It does this so it can delete the checkpoint
and then continue using the checkpoint it just deleted to run the
kill flow transition on a new fiber.

If a killed flow reaches the `FlowDefaultUncaughtExceptionHandler` it
will be forcibly killed via `killFlowForcibly` which deletes the
checkpoint/or updates it to KILLED and then calls `removeFlow` to bypass
any event processing. This means that a flow that was dead and was killed
will be terminated manually if it reaches the handler again. The same is
true for flows that were not dead before but reached the handler after
being killed.

Also, `FlowCreator.createFlowFromCheckpoint` now retains the `isKilled`
state of the previous fiber's state.
2021-01-29 11:15:28 +00:00
.ci NOTICK Publish to correct Docker repository (#6831) 2020-12-03 21:42:57 +00:00
.github NOTICK Update notary code owners (#6828) 2020-11-30 20:17:13 +00:00
.idea Merge remote-tracking branch 'origin/release/os/4.3' into my_merge_branch 2019-11-04 17:48:15 +00:00
buildSrc INFRA-803 Rebuild Docker image tasks (#6804) 2020-11-20 10:21:53 +00:00
client [DRAFT] feat/CORDA-3823-hash-agility-qa-ready (#6789) 2020-11-05 22:05:29 +00:00
common Port of notary query API from ENT (#6837) 2020-12-18 09:59:12 +00:00
confidential-identities Merge branch 'release/os/4.4' into chrisr3-44-merge 2020-03-04 16:27:44 +00:00
config Merge remote-tracking branch 'origin/release/os/4.4' into rni/notick-merge-44-45 2020-09-25 09:57:10 +01:00
core Add ability to set custom initiating flows for NotaryService (#6832) 2021-01-26 13:56:42 +00:00
core-deterministic CORDA-3823: hash agility updates for rc03 (#6800) 2020-11-12 17:03:43 +00:00
core-tests CORDA-3823: hash agility updates for rc03 (#6800) 2020-11-12 17:03:43 +00:00
detekt-plugins NOTICK: Update Gradle files for DeteKt plugins. (#5970) 2020-02-16 08:21:05 +00:00
docker NOTICK: Changes done for creating new branch for 4.8 2020-11-23 14:37:14 +00:00
docs INFRA-270 Publish archived API docs to Artifactory when tagged (#6309) 2020-07-16 10:46:42 +01:00
experimental NOTICK: Fix some Gradle technical debt. (#6430) 2020-07-07 09:08:58 +01:00
finance restored cash changelog v1 to its original state (#6822) 2020-11-27 12:16:50 +00:00
gradle/wrapper CORDA-3892: Upgrade to Gradle 5.6.4 again, with build fixes. (#6448) 2020-07-08 11:34:25 +01:00
isolated CORDA-2893 Upgrade Corda to use Gradle 5.4.1 (Take 2) (#5137) 2019-05-20 14:26:42 +01:00
jdk8u-deterministic NOTICK: Avoid configuring more tasks in the deterministic modules. (#6452) 2020-07-13 10:33:23 +01:00
lib CORDA-3938 Restrict Gradle dependency locations (#6554) 2020-08-03 21:28:26 +01:00
node ENT-6142 Flows become dead due to uncaught exceptions (#4158) 2021-01-29 11:15:28 +00:00
node-api Port of notary query API from ENT (#6837) 2020-12-18 09:59:12 +00:00
node-api-tests CORDA-3979: Support for multiple trust roots (#6772) 2020-10-20 12:18:00 +03:00
release-tools CORDA-3017 - Fix release tooling when product name != jira project (#5229) 2019-06-21 09:28:07 +01:00
samples [DRAFT] feat/CORDA-3823-hash-agility-qa-ready (#6789) 2020-11-05 22:05:29 +00:00
serialization Merge OS 4.5 into OS 4.6 2020-08-25 11:57:54 +01:00
serialization-deterministic NOTICK: Avoid configuring more tasks in the deterministic modules. (#6452) 2020-07-13 10:33:23 +01:00
serialization-djvm Merge commit '38cad333c88f44a37d4869e8f6ff587199024030' into chrisr3-os45-os46-merge 2020-08-10 19:56:45 +01:00
serialization-tests CORDA-4076: Fix SecureHash compatibility with previous versions (#6801) 2020-11-12 09:39:57 +00:00
testing [DRAFT] feat/CORDA-3823-hash-agility-qa-ready (#6789) 2020-11-05 22:05:29 +00:00
tools INFRA-803 Rebuild Docker image tasks (#6804) 2020-11-20 10:21:53 +00:00
.dockerignore WIP Kubenetes parallel build (#5396) 2019-09-03 15:40:08 +00:00
.gitignore INFRA-505: Move integration tests to unit tests (#6530) 2020-08-06 15:16:27 +01:00
build.gradle INFRA-803 Rebuild Docker image tasks (#6804) 2020-11-20 10:21:53 +00:00
BUILD.md add a shared memory port allocator to allow multiple processes to sha… (#5223) 2019-07-02 18:38:33 +00:00
buildCacheSettings.gradle Explicitly disable remote gradle build cache when building locally. (#4095) 2018-10-19 16:40:06 +01:00
constants.properties NOTICK: Changes done for creating new branch for 4.8 2020-11-23 14:37:14 +00:00
CONTRIBUTING.md Combines all contributing info in one place. Clean-up. (#4266) 2018-11-20 18:17:11 +00:00
CONTRIBUTORS.md EG-4168 Updating contributors.md list for OS 4.6 release branch (#6783) 2020-10-22 22:52:47 +01:00
detekt-baseline-config.yml TM-45 Make detektBaseline pass (#5561) 2019-10-15 15:49:31 +01:00
detekt-baseline.xml Port of notary query API from ENT (#6837) 2020-12-18 09:59:12 +00:00
detekt-config.yml [NOTICK] - Enable check in detekt for unused imports (#6106) 2020-03-26 15:46:33 +00:00
deterministic.gradle NOTICK: Avoid configuring more tasks in the deterministic modules. (#6452) 2020-07-13 10:33:23 +01:00
gradle.properties INFRA-424: Merge openj9 updates into 4.6 (#6683) 2020-09-02 14:35:30 +01:00
gradlew CORDA-3892: Upgrade Gradle 5.4.1 -> 5.6.4. (#6435) 2020-07-07 09:07:55 +01:00
gradlew.bat CORDA-3892: Upgrade Gradle 5.4.1 -> 5.6.4. (#6435) 2020-07-07 09:07:55 +01:00
java8.gradle NOTICK: Fix some Gradle technical debt. (#6430) 2020-07-07 09:08:58 +01:00
Jenkinsfile NOTICK: Reverted use of Artifactory cache mechanism (#6526) 2020-07-30 05:25:01 +01:00
LICENSE Use full Apache 2.0 license so GitHub recognizes it 2019-08-23 12:24:37 +02:00
README.md Update README.md (#6144) 2020-04-09 15:31:19 +01:00
SECURITY.md CORDA-2958 Security policy for corda 2019-06-03 10:38:13 +02:00
settings.gradle NOTICK Fix kill flow standalone rpc client test (#6721) 2020-09-18 15:15:44 +01:00
sizing.sh add a shared memory port allocator to allow multiple processes to sha… (#5223) 2019-07-02 18:38:33 +00:00
TRADEMARK Updated URL link to R3 trademark policy 2017-07-13 11:43:41 +01:00

Corda

License

Corda

Corda is an open source blockchain project, designed for business from the start. Only Corda allows you to build interoperable blockchain networks that transact in strict privacy. Corda's smart contract technology allows businesses to transact directly, with value.

Features

  • Smart contracts that can be written in Java and other JVM languages
  • Flow framework to manage communication and negotiation between participants
  • Peer-to-peer network of nodes
  • "Notary" infrastructure to validate uniqueness and sequencing of transactions without global broadcast
  • Enables the development and deployment of distributed apps called CorDapps
  • Written in Kotlin, targeting the JVM

Getting started

  1. Read the Getting Started documentation
  2. Run the Example CorDapp
  3. Read about Corda's Key Concepts
  4. Follow the Hello, World! tutorial

Contributing

Corda is an open-source project and contributions are welcome!

To find out how to contribute, please see our contributing docs.

License

Apache 2.0

Acknowledgements

YourKit

YourKit supports open source projects with its full-featured Java Profiler.

YourKit, LLC is the creator of YourKit Java Profiler and YourKit .NET Profiler, innovative and intelligent tools for profiling Java and .NET applications.