Commit Graph

9018 Commits

Author SHA1 Message Date
Viktor Kolomeyko
9fc896beb3
CORDA-3960: Port MultiRPCClient to OS (#6644)
* CORDA-3960: Port MultiRPCClient to OS

* CORDA-3960: Carefully restore serialisation environment in `MultiRpcClientTest` to eliminate side effects on other tests

* CORDA-3960: Move ThreadDumpUtils.kt to `core-utils`
2020-08-18 10:35:19 +01:00
Viktor Kolomeyko
d55676b452
CORDA-3959: Fix affected smoke test (#6633) 2020-08-14 09:20:11 +01:00
Viktor Kolomeyko
b81eb1559d
CORDA-3959: Eliminate InternalCordaRPCOps (#6600)
* CORDA-3959: Make `ThreadContextAdjustingRpcOpsProxy` flexible for `RPCOps` it uses

* CORDA-3959: More changes towards supporting multiple `RPCOps` implementations

* CORDA-3959: Detekt baseline update

* CORDA-3959: Integration test compilation fix

* CORDA-3959: Introduce `CheckpointRPCOpsImpl` and wire it on

* CORDA-3959: Use multiple RPCOps interfaces in the shell commands

* CORDA-3959: Detekt baseline update

* CORDA-3959: Update RPCPermissionsTests

* CORDA-3959: Update RPCSecurityManagerTest

* CORDA-3959: Remove deprecated marker and rename the property

* CORDA-3959: Detekt baseline

* CORDA-3959: Introduce AttachmentTrustInfoRPCOpsImpl and wire it on

* CORDA-3959: Delete `InternalCordaRPCOps`

* CORDA-3959: Detekt baseline update

* CORDA-3959: Rename `CheckpointRPCOps` to `FlowManagerRPCOps`
2020-08-13 14:41:52 +01:00
Alexey Kadyrov
c12c582eb4
Set release version to be 4.7 (#6623) 2020-08-12 15:55:49 +01:00
Alexey Kadyrov
518026c6c4
Changed the counter parties in the query to be CordaX509Name (#6622) 2020-08-12 14:53:03 +01:00
Chris Rankin
57de0c4eec
CORDA-3987: Upgrade to Corda Gradle plugins 5.0.12. (#6621) 2020-08-12 14:30:40 +01:00
Alexey Kadyrov
0b6b69bbda
CORDA-3657/5459 inspect waiting flows (#6540)
* CORDA-3657 Extract information from state machine

`FlowReadOperations` interface provides functions that extract
information about flows from the state machine manager.

`FlowOperator` implements this interface (along with another currenly
empty interface).

* CORDA-3657 Rename function and use set

* initial test is passing

* wip

* done tests

* additional tests to cover more FlowIORequest variations

* completed tests

* The quasar.jar should nat have been changed

* Fixed issues reported by detekt

* got rid of sync objects, instead relying on nodes being offline

* Added extra grouping test and minor simplification

* Hospital test must use online node which fails on otherside

* Added additional information required for the ENT

* Added tests to cover SEND FlowIORequests

* using node name constants from the core testing module

* Changed flow operator to the query pattern

* made query fields mutable to simply building query

* fixed detekt issue

* Fixed test which had dependency on the order int the result (failed for windows)

* Fixed recommendations in PR

* Moved WrappedFlowExternalOperation and  WrappedFlowExternalAsyncOperation to FlowExternalOperation.kt as per PR comment

* Moved extension to FlowAsyncOperation

* removed unnecessarily brackets

Co-authored-by: LankyDan <danknewton@hotmail.com>
2020-08-12 10:14:05 +01:00
Chris Rankin
5778edae8f
CORDA-3984: Update to DJVM 1.1.1 to fix multi-release jars on Java 11. (#6591) 2020-08-11 17:12:54 +01:00
Rick Parker
011e8d824b
Merge pull request #6611 from corda/chrisr3-os46-os47-merge
NOTICK: Merge OS 4.6 -> OS 4.7 up to a9799fd.
2020-08-11 15:12:58 +01:00
Rick Parker
a9799fd227
Merge pull request #6609 from corda/chrisr3-os45-os46-merge
NOTICK: Merge OS 4.5 to OS 4.6 up to 38cad33.
2020-08-11 09:12:52 +01:00
Ross Nicoll
12e7fa1d93
CORDA-3981 Disable unstable config helper test (#6610) 2020-08-10 20:35:15 +01:00
Ross Nicoll
29e87a586a
CORDA-3973 Fix memory leak due to DB not shutting down (#6605)
Fix memory leak due to DB not shutting down in FlowFrameworkPersistenceTests.flow restarted just after receiving payload.

Also reduces number of class-wide variables to reduce scope for references being accidentally held between runs.
2020-08-10 20:04:51 +01:00
Chris Rankin
f22bb3a15a Merge commit '38cad333c88f44a37d4869e8f6ff587199024030' into chrisr3-os45-os46-merge 2020-08-10 19:56:45 +01:00
Ross Nicoll
38cad333c8
Merge pull request #6608 from corda/chrisr3-os44-os45-merge
NOTICK: Merge from OS 4.4 into OS 4.5
2020-08-10 19:52:18 +01:00
Dan Newton
c191960cb8
CORDA-3948 Make KillFlowTest less flakey (#6606)
`KillFlowTest` is failing quite often. This is probably due to issues in ordering when taking and releasing locks. By using `CountDownLatch` in places instead of `Semaphore`s should reduce the likelihood of tests failing.
2020-08-10 16:59:28 +01:00
Chris Rankin
d4bedfd1d5 Merge commit '83f8e00612b02818b62c9173e0798637d4114f82' into chrisr3-os44-os45-merge 2020-08-10 16:50:35 +01:00
Rick Parker
9832119c0e
Merge pull request #6575 from corda/jzd/notick-os4.4-to-os4.5-merge-2020-08-05
NOTICK: OS 4.4 to OS 4.5 merge 2020-08-05
2020-08-10 16:22:53 +01:00
Chris Rankin
83f8e00612
CORDA-3936: Add a fallback mechanism for Enums incorrectly serialised using their toString() method. (#6603)
* CORDA-3936: Add a fallback mechanism for Enums incorrectly serialised using their toString() method.

* Backport missing piece of Enum serializer from Corda 4.6.
2020-08-10 15:31:55 +01:00
Yiftach Kaplan
8aafb1db4a
INFRA-545: Convert a few tests to unit tests; rename another test (#6562) 2020-08-10 15:25:28 +01:00
Dan Newton
66406ba0fb
ENT-5450 Resume flow when transition creation errors (#6604)
If an error occurs when creating a transition (a.k.a anything inside of
`TopLevelTransition`) then resume the flow with the error that occurred.

This is needed, because the current code is swallowing all errors thrown
at this point and causing the flow to hang.

This change will allow better debugging of errors since the real error
will be thrown back to the flow and will get handled and logged by the
normal error code path.

Extra logging has been added to `processEventsUntilFlowIsResumed`, just
in case an exception gets thrown out of the normal code path. We do not
want this exception to be swallowed as it can make it impossible to
debug the original error.
2020-08-10 13:09:43 +01:00
Tamas Veingartner
e234bd9c96
fix for Could not reconnect to the RPC server“ error on shutdown via Shell-Cli (#6595)
an RPCUtils created to centralize method name related operations
2020-08-10 09:51:24 +01:00
Joseph Zuniga-Daly
62e623f83a
Merge branch 'release/os/4.5' into jzd/notick-os4.4-to-os4.5-merge-2020-08-05 2020-08-07 16:54:20 +01:00
Waldemar Żurowski
922dbe8544
Merge pull request #6592 from corda/wz/merge-os-45-46-2020-08-07
NOTICK: Merging forward updates from OS 4.5 to OS 4.6
2020-08-07 13:23:49 +01:00
Waldemar Zurowski
affd9ebad6 Merge branch 'release/os/4.5' into wz/merge-os-45-46-2020-08-07 2020-08-07 12:24:13 +02:00
Waldemar Żurowski
e155cf8d96
Merge pull request #6590 from corda/wz/merge-os-44-45-2020-08-07
NOTICK: Merging forward updates from OS 4.4 to OS 4.5
2020-08-07 11:22:33 +01:00
Waldemar Zurowski
8e368a2b76 Synched JDK11 Azul builds configuration with regression build
* carries over INFRA-541 and INFRA-542
2020-08-07 11:44:14 +02:00
Tamas Veingartner
e6af60edda
NOTICK Migrate recent RPC related changes to OS, as these were initially imp… (#6532)
* Migrate recent RPC related changes to OS, as these were initially implemented in ENT only

* tests cleanup

* cleanup imports
2020-08-07 09:18:09 +01:00
Waldemar Zurowski
805e9e9f9f NOTICK: Merging forward updates from OS 4.4 to OS 4.5 2020-08-07 06:16:53 +02:00
Waldemar Zurowski
56b574c66e Fixed missing elements 2020-08-07 06:07:29 +02:00
Dan Newton
0d5ee8b0fa
NOTICK Save exception for hospitalized session init errors (#6587)
Save the exception for flows that fail during session init when they are
kept for observation.

Change the exception tidy up logic to only update the flow's status if
the exception was removed.
2020-08-06 22:35:05 +01:00
Chris Rankin
ef27dbfdbb
INFRA-563: Upgrade to distributed-testing-plugin 1.3.0. (#6588) 2020-08-06 22:13:57 +01:00
Waldemar Żurowski
e524f41738
INFRA-542: Allow change of the default Nexus IQ stage parameter (#6586)
* adds a parameter to a build
* default value of the parameter is the same as original stage parameter
2020-08-06 20:20:19 +01:00
Waldemar Żurowski
d19c6dddaf
INFRA-541: Remove obsolete jenkins prefix from Nexus AppID (#6585) 2020-08-06 20:17:15 +01:00
Yiftach Kaplan
849d51c8cd
INFRA-505: Move integration tests to unit tests (#6530) 2020-08-06 15:16:27 +01:00
Rick Parker
02b71845bb
Merge pull request #6583 from corda/feature_pass_in_client_id_when_starting_a_flow-os_4.6
ENT-4565 - It is always clear whether a flow has been successfully started via RPC
2020-08-06 15:15:13 +01:00
Dan Newton
b4235c6842
Merge pull request #6581 from corda/os_4.6-feature_pass_in_client_id_when_starting_a_flow
NOTICK - OS 4.6 to feature/pass_in_client_id_when_starting_a_flow
2020-08-06 14:31:44 +01:00
Kyriakos Tharrouniatis
0005317fec Align code with merging changes 2020-08-06 13:35:46 +01:00
Kyriakos Tharrouniatis
2afedeabb4 Merge branch 'release/os/4.6' into os_4.6-feature_pass_in_client_id_when_starting_a_flow 2020-08-06 13:21:45 +01:00
Rick Parker
f280ec9fd9
Merge pull request #6578 from corda/WillV/ENT-5395-Pause-and-Resume-Flows
ENT-5395 Pause and Resume Flows
2020-08-06 11:47:38 +01:00
Dan Newton
3f31aeaa5f
CORDA-3822 Add CordaRPCOps.reattachFlowWithClientId (#6579)
Add `CordaRPCOps.reattachFlowWithClientId` to allow clients to reattach
to an existing flow by only providing a client id. This behaviour is the
same as calling `startFlowDynamicWithClientId` for an existing
`clientId`. Where it differs is `reattachFlowWithClientId` will return
`null` if there is no flow running or finished on the node with the same
client id.

Return `null` if record deleted from race-condition
2020-08-06 11:42:02 +01:00
Will Vigor
7acc510534 CORDA-3602 Set a Checkpoint as incompatible if it can't be deserialised (#3653)
Update the compatible flag in the DB if the flowstate cannot be deserialised.

The most common cause of this problem is if a CorDapp has been upgraded
without draining flows from the node.

`RUNNABLE` and `HOSPITALISED` flows are restored on node startup so
the flag is set for these then. The flag can also be set when a flow
retries for some reason (see retryFlowFromSafePoint) in this case the
problem has been caused by another reason.
2020-08-06 11:00:02 +01:00
Will Vigor
4a828fcb99 ENT-5397 Pause individual running and hospitalised flows (#3564)
Added a newpause event to the statemachine which returns an Abort
continuation and causes the flow to be moved into the Paused flow Map.

Flows can receive session messages whilst paused.
2020-08-06 10:40:09 +01:00
Will Vigor
bbf5a93761 ENT-5396 Allow Retrying a Hospitalised Flow from the Statemachine (#3499)
Added functionality to the statemachine to enable retrying a Hospitalised flow without a node restart.
2020-08-06 10:11:15 +01:00
Dan Newton
a73dad00e2
CORDA-3850 Add a per flow lock (#6437)
Add a lock to `StateMachineState`, allowing every flow to lock
themselves when performing a transition or when an external thread (such
as `killFlow`) tries to interact with a flow from occurring at the same
time.

Doing this prevents race-conditions where the external threads mutate
the database or the flow's state causing an in-flight transition to
fail.

A `Semaphore` is used to acquire and release the lock. A `ReentrantLock`
is not used as it is possible for a flow to suspend while locked, and
resume on a different thread. This causes a `ReentrantLock` to fail when
releasing the lock because the thread doing so is not the thread holding
the lock. `Semaphore`s can be used across threads, therefore bypassing
this issue.

The lock is copied across when a flow is retried. This is to prevent
another thread from interacting with a flow just after it has been
retried. Without copying the lock, the external thread would acquire the
old lock and execute, while the fiber thread acquires the new lock and
also executes.
2020-08-06 09:51:42 +01:00
Kyriakos Tharrouniatis
5ba8477733
CORDA-3491 - Do not keep flow state in memory after a flow has finished (#6573)
Do not retain in database `checkpoint.flowState` for flows that have completed 
or failed and have started with a client id, after their lifetime.
2020-08-06 09:46:04 +01:00
Ross Nicoll
fd374bfc6d
CORDA-3943 Remove sleeps from flow reload tests (#6567)
* Remove use of Thread.sleep() FROM FlowReloadAfterCheckpointTest, instead relying on CountdownLatch to wait until the target number has been hit or a timeout occurs, so the thread can continue as soon as the target is hit.
* Replace use of hashmaps to a concurrent queue, to mitigate risk of complex threading issues.
2020-08-05 21:10:11 +01:00
Anurag Garg
01451d57b9
Merge pull request #6577 from corda/adel/CORDA-3950
CORDA-3950: Now disable SPHINCS for JDK8 as well as JDK11. Broken in …
2020-08-05 19:11:52 +01:00
Adel El-Beik
4a5f928ac3 CORDA-3950: Doh. Fix the unused import. 2020-08-05 16:37:36 +01:00
Adel El-Beik
f952021b58 CORDA-3950: Now disable SPHINCS for JDK8 as well as JDK11. Broken in JDK1.8_252 2020-08-05 16:30:38 +01:00
Jonathan Locke
badfcf7f07
CORDA-3942: Disable IRSDemoTest (#6564)
Temporarily disable IRSDemoTest as it is breaking many OS builds.
2020-08-05 15:49:12 +01:00