Commit Graph

9037 Commits

Author SHA1 Message Date
LankyDan
82bcde573b NOTICK Resume flow when wrong message received
When an incorrect message is received, the flow should resume to allow
it to throw the error back to user code and possibly cause the flow to
fail.

For now, if an `EndSessionMessage` is received instead of a
`DataSessionMessage`, then an `UnexpectedFlowEndException` is thrown
back to user code. Allowing it to correctly re-enter normal flow error
handling.

Without this change, the flow will hang due to it failing while creating
a transition which exists outside of the general state machine error
handling code path.
2020-07-31 14:28:57 +01:00
LankyDan
39dbe22c9d ENT-5532 Terminate sessions after original io request
Sessions are now terminated after performing the original
`FlowIORequest` passed into `StartedFlowTransition`, instead of before.
This is done by scheduling an `Event.TerminateSessions` if there are
sessions to terminate when performing a suspending event.

Originally this was done by hijacking a transition that is trying to
perform a `StartedFlowTransition`, terminating the sessions and then
scheduling another `Event.DoRemainingWork` to perform the original
transition. This introduced a bug where, another event (from a external
message) could be placed onto the queue before the
`Event.DoRemainingWork` could be added. In most scenarios, that should
be ok. But, if a flow is retrying (while in an uninitiated state) and
this occurs the flow could fail due to being in an unexpected state.

Terminating the sessions after performing the original transition
removes this possibility. Meaning that a restarting flow will always
perform the transition they supposed to do (based on the called
suspending event).
2020-07-31 12:37:44 +01:00
Christian Sailer
4097d54a31
Merge pull request #6535 from corda/christians/ENT-5273-update-fb-from-os.4.6
ENT-5273 update feature branch from os.4.6
2020-07-31 11:51:55 +01:00
James Higgs
250ed8a21a
Merge pull request #6533 from corda/eg-177merge
EG-177   Network Parameter Hotloading
2020-07-31 09:45:23 +01:00
Viktor Kolomeyko
c498c5bf7c
CORDA-3871: New integration test for handshake timeout in AMQPClient (#6519)
* CORDA-3871: Import external code

Compiles, but does not work for various reasons

* CORDA-3871: More improvements to imported code

Currently fails due to keystores not being found

* CORDA-3871: Initialise keystores for the server

Currently fails due to keystores for client not being found

* CORDA-3871: Configure certificates to client

The program started to run

* CORDA-3871: Improve debug output

* CORDA-3871: Few more minor changes

* CORDA-3871: Add AMQClient test

Currently fails due to `localCert` not being set

* CORDA-3871: Configure server to demand client to present its certificate

* CORDA-3871: Changes to the test to make it pass

ACK status is not delivered as server is not talking AMQP

* CORDA-3871: Add delayed handshake scenario

* CORDA-3871: Tidy-up imported classes

* CORDA-3871: Hide thread creation inside `ServerThread`

* CORDA-3871: Test description

* CORDA-3871: Detekt baseline update

* CORDA-3871: Trigger repeated execution of new tests

To make sure they are not flaky

* CORDA-3871: Improve robustness of the newly introduced tests

* CORDA-3871: Improve robustness of the newly introduced tests

* CORDA-3871: New tests proven to be stable - reduce number of iterations to 1

* CORDA-3871: Adding Alex Karnezis to the list of contributors
2020-07-31 09:26:32 +01:00
Ross Nicoll
68feb1c35f
CORDA-3932 Correct race condition in FlowVersioningTest (#6536)
Correct race condition in FlowVersioningTest where the last message is read (and the session close can be triggered)
before one side has finished reading metadata from the session.
2020-07-31 08:32:20 +01:00
Christian Sailer
81d68abe7e Merge remote-tracking branch 'origin/release/os/4.6' into christians/ENT-5273-update-fb-from-os.4.6 2020-07-30 18:39:04 +01:00
Paul Hatcher
87faf35ecb
CORDA-3929 : quasar 0.7.12_r3 -> quasar 0.7.13_r3 (#6522) 2020-07-30 17:08:00 +01:00
Peter Nemeth
777be6c11a Merge branch 'feature/EG-177' of https://github.com/corda/corda into feature/EG-177 2020-07-30 16:20:01 +01:00
pnemeth
2a27f3ac37
EG-2055 Implement network parameters hotloading (#6517)
* Implement network parameters hotloading

* fixed failing unit test

* PR comments

* PR comments

* added integr tests+ renamed updater to hotloader

* moved exiting logic out of hotloader

* extra tests

* latest PR comments

* refactor

* address detekt/suppress if more significant refactoring needed

* extra tests

* addressed PR comments

* detekt

* formatting
2020-07-30 16:02:33 +01:00
Ross Nicoll
fd5472b053
NOTICK Remove memory leak endurance test (#6514)
Remove memory leak endurance test as it spends 8 minutes testing a single failure case that's not end user visible,
and ultimately manifests elsewhere in test failures (which is where this came from in the beginning). It was a good
idea to confirm the change fixed the issue, but this isn't critical enough to retain.
2020-07-30 15:39:28 +01:00
Dan Newton
35bfa6945f
Merge pull request #6529 from corda/os_4.6-feature_pass_in_client_id_when_starting_a_flow-merge
NOTICK - OS 4.6 to feature/pass_in_client_id_when_starting_a_flow merge
2020-07-30 12:30:21 +01:00
Jonathan Locke
530c5eadf8
INFRA-549: Commented out Sonatype checks during regression builds for now. (#6528)
Commented out Sonatype checks during regression builds for now.
2020-07-30 11:27:45 +01:00
Kyriakos Tharrouniatis
f2bcc85f30 Fix compilation error 2020-07-30 10:54:24 +01:00
Kyriakos Tharrouniatis
8a37108a58 Merge branch 'release/os/4.6' into os_4.6-feature_pass_in_client_id_when_starting_a_flow-merge 2020-07-30 10:34:03 +01:00
Waldemar Żurowski
5f8d70f5e3
Merge pull request #6527 from corda/wz/merge-os-45-46-2020-07-30
NOTICK: Merging forward updates from OS 4.5 to OS 4.6
2020-07-30 07:01:29 +01:00
Waldemar Zurowski
02990b9dc0 Merge branch 'release/os/4.5' into wz/merge-os-45-46-2020-07-30 2020-07-30 05:37:46 +01:00
Waldemar Żurowski
a81e871356
NOTICK: Reverted use of Artifactory cache mechanism (#6526) 2020-07-30 05:25:01 +01:00
Kyriakos Tharrouniatis
ad61d7b3f4
CORDA-3692 - Store result information in checkpoint results table (#6473)
Making statemachine not remove COMPLETED flows' checkpoints from the database 
if they are started with a clientId, instead they are getting persisted and retained within 
the database along with their result (`DBFlowResult`).

On flow start with a client id (`startFlowDynamicWithClientId`), if the client id maps to
a flow that was previously started with the same client id and the flow is now finished, 
then fetch the `DBFlowResult` from the database to construct a 
`FlowStateMachineHandle` done future and return it back to the client.

Object stored as results must abide by the storage serializer rules. If they fail to do so
the result will not be stored and an exception is thrown to the client to indicate this.
2020-07-29 15:57:00 +01:00
Yiftach Kaplan
0bedbd8c75
INFRA-530: Start notary node in process (#6521) 2020-07-29 15:47:45 +01:00
Ross Nicoll
c91dba83d3
Merge pull request #6523 from corda/wz/merge-os-45-46-2020-07-28
NOTICK: Merging forward updates from OS 4.5 to OS 4.6
2020-07-28 16:50:00 +01:00
Dan Newton
c2fd8253ea
CORDA-3777 Reload after every checkpoint (#6494)
Enable reloading of a flow after every checkpoint is saved. This
includes reloading the checkpoint from the database and recreating the
fiber.

When a flow and its `StateMachineState` is created it checks the node's
config to see if the `reloadCheckpointAfterSuspend` is set to true. If it is
it initialises `StateMachineState.reloadCheckpointAfterSuspendCount`
with the value 0. Otherwise, it remains `null`.

This count represents how many times the flow has reloaded from its
checkpoint (not the same as retrying). It is incremented every time the
flow is reloaded.

When a flow suspends, it processes the suspend event like usual, but
it will now also check if `reloadCheckpointAfterSuspendCount` is not
`null` (that it is activated) and process a 
`ReloadFlowFromCheckpointAfterSuspend`event, if and only if 
`reloadCheckpointAfterSuspendCount` is greater than
`CheckpointState.numberOfSuspends`.

This means idempotent flows can reload from the start and not reload
again until reaching a new suspension point.

Flows that skip checkpoints can reload from a previously saved
checkpoint (or from the initial checkpoint) and will continue reloading
on reaching the next new suspension point (not the suspension point that
it skipped saving).

If the flow fails to deserialize the checkpoint from the database upon
reloading a `ReloadFlowFromCheckpointException` is throw. This causes
the flow to be kept for observation.
2020-07-28 16:27:51 +01:00
Stefan Iliev
52cbe04b8c
EG-2375 - batching notary open sourcing. (#6507) 2020-07-28 15:50:19 +01:00
Dimitris Gounaris
1e6be340eb
CORDA-3844: bulk node infos request (#6411)
* CORDA-3844: Add new functions to network map client

* CORDA-3844: Apply new fetch logic to nm updater

* CORDA-3844: Fix base url and warnings

* CORDA-3844: Change response object and response validation

In order to make sure that the returned node infos are not maliciously modified, either a signed list response
or a signed reference object would need to be provided. As providing a signed list requires a lot of effort from NM and Signer services,
the signed network map is provided instead, allowing nodes to validate that the list provided conforms to the entries of the signed network map.

* CORDA-3844: Add clarifications and comments

* CORDA-3844: Add error handling for bulk request

* CORDA-3844: Enhance testing

* CORDA-3844: Fix detekt issues

* EG-3844: Apply pr suggestions
2020-07-28 15:02:53 +01:00
Waldemar Zurowski
e95ff388da Merge branch 'release/os/4.5' into wz/merge-os-45-46-2020-07-28 2020-07-28 14:14:43 +01:00
Waldemar Żurowski
ebdcc97dda
Merge pull request #6520 from corda/INFRA-427-Store-14-days-of-builds
Added missing buildDiscarder to docs API publisher Jenkins configuration
2020-07-28 11:31:52 +01:00
Dimos Raptis
f2336f397d
CORDA-3506 - Add test for session close API (#6512) 2020-07-28 10:20:24 +01:00
Waldemar Zurowski
7f94f6cb39 Added missing buildDiscarder to docs API publisher Jenkins configuration
* updated regex for recognised tag to match JenkinsUI configuration
2020-07-28 09:36:11 +01:00
Ryan Fowler
d4189c4f37
CORDA-3918: Port of ENT-5417: Allow exceptions to propagate when shutdown commands are called (#6516) 2020-07-27 14:09:26 +01:00
Christian Sailer
16af890b3d
Merge pull request #6511 from corda/christians/ENT-5273-update-from-os-4.6
ENT-5273 update from os 4.6
2020-07-24 15:52:45 +01:00
Christian Sailer
c4748e0588 Postpone notary configuration in driver DSL (matching original behaviour) to get around the service name check in registration. 2020-07-24 10:18:45 +01:00
Ross Nicoll
310fa5e082
Merge pull request #6513 from corda/rni/notick/merge-4.4-4.5
NOTICK Merge 4.4 to 4.5
2020-07-23 18:33:08 +01:00
Christian Sailer
19e11619b4 Remove unused import 2020-07-23 17:59:54 +01:00
Ross Nicoll
9527c553ec Merge remote-tracking branch 'origin/release/os/4.4' into rni/notick/merge-4.4-4.5 2020-07-23 17:24:36 +01:00
Ross Nicoll
13073c300f
NOTICK: OS 4.3 to OS 4.4 merge (#6506)
* CORDA-3917 Update to Jackson 2.9.8 (#6493)

* Update to Jackson 2.9.8 to address multiple security issues, and update warning note about
updates to clarify that it refers to 2.10+. When the note was added 2.9.7 as the highest
available version in the 2.9.x series.
* Add PR code checks Jenkinsfile

* CORDA-3916 Update to BouncyCastle 1.61 (#6492)

Update to BouncyCastle 1.61. Updating one version at a time to mitigate risk of a complex breaking change being introduced.

* Added missing collection of JUnit tests and logs

Co-authored-by: Waldemar Zurowski <waldemar.zurowski@r3.com>
2020-07-23 16:59:42 +01:00
Ryan Fowler
2ca10464b7
CORDA-3845: Update BC, log4j, slf4j (#6464)
* CORDA-3845: Update BC to 1.64

* CORDA-3845: Upgraded log4j to 2.13.3

* We can remove the use of Manifests from the logging package so that when _it_ logs it doesn't error on the fact the stream was already closed by the default Java logger.

* Some more tidy up

* Remove the logging package as a plugin

* latest BC version

* Remove old test

* fix up

* Fix some rebased changes to log file handling

* Fix some rebased changes to log file handling

* Update slf4j too

Co-authored-by: Adel El-Beik <adel.el-beik@r3.com>
2020-07-23 16:37:29 +01:00
Yiftach Kaplan
4acf41ea3d
INFRA-477: Start nodes in parallel when possible (#6460)
Co-authored-by: Ross Nicoll <ross.nicoll@r3.com>
2020-07-23 16:35:34 +01:00
Ross Nicoll
05c2428f2f
NOTICK Add more detail on signature build failures (#6510)
Add details of the signature provider and key algorithm if `InvalidKeyException` is thrown when constructing a `ContentSigner`, in order to be able to usefully diagnose incorrect signature providers or similar errors.
2020-07-23 15:17:59 +01:00
Christian Sailer
db94f65d8a Merge remote-tracking branch 'origin/release/os/4.6' into christians/ENT-5273-update-from-os-4.6 2020-07-23 14:02:18 +01:00
Waldemar Zurowski
0b1ccb48d0 Merge branch 'release/os/4.5' into wz/merge-os-45-46-2020-07-23 2020-07-23 11:31:43 +01:00
Waldemar Żurowski
6a51a3fe1f
Merge pull request #6509 from corda/wz/merge-os-44-45-2020-07-23
NOTICK: Merging forward Jenkins configuration updates from OS 4.4 to OS 4.5
2020-07-23 11:29:31 +01:00
Waldemar Zurowski
2e6bd97fe9 Updates
* INFRA-508: NexusIQ stage for GA releases updated to `release`
* do not truncate stdio when collecting JUnit tests
2020-07-23 10:46:32 +01:00
Waldemar Zurowski
49c86af354 Merge branch 'release/os/4.4' into wz/merge-os-44-45-2020-07-23 2020-07-23 10:39:12 +01:00
Waldemar Żurowski
14279a30cc
INFRA-508: NexusIQ stage for GA releases updated to release (#6508) 2020-07-23 10:36:48 +01:00
Waldemar Zurowski
4e0ebefbcc Merge branch 'release/os/4.5' into release/os/4.6 2020-07-22 19:56:07 +01:00
Waldemar Zurowski
136743ae61 Merge branch 'release/os/4.4' into release/os/4.5 2020-07-22 19:55:12 +01:00
Waldemar Zurowski
f60f06a85f INFRA-508: Change appID in sonatype stage for Corda and Corda Enterprise 2020-07-22 19:54:41 +01:00
Waldemar Zurowski
8a4e522227 Merge branch 'release/os/4.5' into release/os/4.6 2020-07-22 19:45:50 +01:00
Waldemar Zurowski
4d03bcb7ed Merge branch 'release/os/4.4' into release/os/4.5 2020-07-22 19:44:21 +01:00
Waldemar Zurowski
0842ea26b7 NOTICK: Backport Jenkins configuration for nightly builds to release 4.4 2020-07-22 19:43:08 +01:00