=pro fixup in PR validation logging logic

This commit is contained in:
Konrad Malawski 2015-07-07 16:55:35 +02:00
parent 874d07c0ae
commit 561d46e2da
5 changed files with 46 additions and 15 deletions

View file

@ -362,11 +362,11 @@ Persisting, deleting and replaying messages can eitehr succeed or fail.
+---------------------------------+-----------------------------+-------------------------------+-----------------------------------+
| ``persist`` / ``persistAsync`` | persist handler invoked | ``onPersistFailure`` | Actor is stopped. |
| | +-------------------------------+-----------------------------------+
| | | ``onPersistRejected`` | --- |
| | | ``onPersistRejected`` | No automatic actions. |
+---------------------------------+-----------------------------+-------------------------------+-----------------------------------+
| ``recovery`` | ``RecoverySuccess`` | ``onRecoveryFailure`` | Actor is stopped. |
+---------------------------------+-----------------------------+-------------------------------+-----------------------------------+
| ``deleteMessages`` | ``DeleteMessagesSuccess`` | ``DeleteMessagesFailure`` | --- |
| ``deleteMessages`` | ``DeleteMessagesSuccess`` | ``DeleteMessagesFailure`` | No automatic actions. |
+---------------------------------+-----------------------------+-------------------------------+-----------------------------------+
The most important operations (``persist`` and ``recovery``) have failure handlers modelled as explicit callbacks which
@ -488,9 +488,25 @@ saved snapshot matches the specified ``SnapshotSelectionCriteria`` will replay a
Snapshot deletion
-----------------
A persistent actor can delete individual snapshots by calling the ``deleteSnapshot`` method with the sequence number and the
timestamp of a snapshot as argument. To bulk-delete snapshots matching ``SnapshotSelectionCriteria``, persistent actors should
use the ``deleteSnapshots`` method.
A persistent actor can delete individual snapshots by calling the ``deleteSnapshot`` method with the sequence number of
when the snapshot was taken.
To bulk-delete a range of snapshots matching ``SnapshotSelectionCriteria``,
persistent actors should use the ``deleteSnapshots`` method.
Snapshot status handling
------------------------
Saving or deleting snapshots can either succeed or fail this information is reported back to the persistent actor via
status messages as illustrated in the following table.
============================================== ========================== ==============================
**Method** **Success** **Failure message**
============================================== ========================== ==============================
``saveSnapshot(Any)`` ``SaveSnapshotSuccess`` ``SaveSnapshotFailure``
``deleteSnapshot(Long)`` ``DeleteSnapshotSuccess`` ``DeleteSnapshotFailure``
``deleteSnapshots(SnapshotSelectionCriteria)`` ``DeleteSnapshotsSuccess`` ``DeleteSnapshotsFailure``
============================================== ========================== ==============================
.. _at-least-once-delivery-java-lambda:

View file

@ -365,11 +365,11 @@ Persisting, deleting and replaying messages can eitehr succeed or fail.
+---------------------------------+-----------------------------+-------------------------------+-----------------------------------+
| ``persist`` / ``persistAsync`` | persist handler invoked | ``onPersistFailure`` | Actor is stopped. |
| | +-------------------------------+-----------------------------------+
| | | ``onPersistRejected`` | --- |
| | | ``onPersistRejected`` | No automatic actions. |
+---------------------------------+-----------------------------+-------------------------------+-----------------------------------+
| ``recovery`` | ``RecoverySuccess`` | ``onRecoveryFailure`` | Actor is stopped. |
+---------------------------------+-----------------------------+-------------------------------+-----------------------------------+
| ``deleteMessages`` | ``DeleteMessagesSuccess`` | ``DeleteMessagesFailure`` | --- |
| ``deleteMessages`` | ``DeleteMessagesSuccess`` | ``DeleteMessagesFailure`` | No automatic actions. |
+---------------------------------+-----------------------------+-------------------------------+-----------------------------------+
The most important operations (``persist`` and ``recovery``) have failure handlers modelled as explicit callbacks which
@ -497,6 +497,20 @@ when the snapshot was taken.
To bulk-delete a range of snapshots matching ``SnapshotSelectionCriteria``,
persistent actors should use the ``deleteSnapshots`` method.
Snapshot status handling
------------------------
Saving or deleting snapshots can either succeed or fail this information is reported back to the persistent actor via
status messages as illustrated in the following table.
============================================== ========================== ==============================
**Method** **Success** **Failure message**
============================================== ========================== ==============================
``saveSnapshot(Any)`` ``SaveSnapshotSuccess`` ``SaveSnapshotFailure``
``deleteSnapshot(Long)`` ``DeleteSnapshotSuccess`` ``DeleteSnapshotFailure``
``deleteSnapshots(SnapshotSelectionCriteria)`` ``DeleteSnapshotsSuccess`` ``DeleteSnapshotsFailure``
============================================== ========================== ==============================
.. _at-least-once-delivery-java:
At-Least-Once Delivery

View file

@ -353,11 +353,11 @@ Persisting, deleting and replaying messages can eitehr succeed or fail.
+---------------------------------+-----------------------------+-------------------------------+-----------------------------------+
| ``persist`` / ``persistAsync`` | persist handler invoked | ``onPersistFailure`` | Actor is stopped. |
| | +-------------------------------+-----------------------------------+
| | | ``onPersistRejected`` | --- |
| | | ``onPersistRejected`` | No automatic actions. |
+---------------------------------+-----------------------------+-------------------------------+-----------------------------------+
| ``recovery`` | ``RecoveryCompleted`` | ``onRecoveryFailure`` | Actor is stopped. |
+---------------------------------+-----------------------------+-------------------------------+-----------------------------------+
| ``deleteMessages`` | ``DeleteMessagesSuccess`` | ``DeleteMessagesFailure`` | --- |
| ``deleteMessages`` | ``DeleteMessagesSuccess`` | ``DeleteMessagesFailure`` | No automatic actions. |
+---------------------------------+-----------------------------+-------------------------------+-----------------------------------+
The most important operations (``persist`` and ``recovery``) have failure handlers modelled as explicit callbacks which
@ -499,14 +499,14 @@ status messages as illustrated in the following table.
============================================== ========================== ==============================
**Method** **Success** **Failure message**
============================================== ========================== ==============================
``saveSnapshot`` ``SaveSnapshotSuccess`` ``SaveSnapshotFailure``
``saveSnapshot(Any)`` ``SaveSnapshotSuccess`` ``SaveSnapshotFailure``
``deleteSnapshot(Long)`` ``DeleteSnapshotSuccess`` ``DeleteSnapshotFailure``
``deleteSnapshots(SnapshotSelectionCriteria)`` ``DeleteSnapshotsSuccess`` ``DeleteSnapshotsFailure``
============================================== ========================== ==============================
If failure messages are left unhandled by the actor, a default warning log message will be logged for each incoming failure message.
No default action is performed on the success messages, however you're free to handle them e.g. in order to delete
an in memory representation of the snapshot, or in the case of failure to attempt save the snapshot aggain.
an in memory representation of the snapshot, or in the case of failure to attempt save the snapshot again.
.. _at-least-once-delivery:

View file

@ -149,6 +149,7 @@ abstract class JournalSpec(config: Config) extends PluginSpec(config) {
subscribe[DeleteMessagesTo](sub.ref)
journal ! cmd
sub.expectMsg(cmd)
receiverProbe2.expectMsg(DeleteMessagesSuccess(cmd.toSequenceNr))
journal ! ReplayMessages(1, Long.MaxValue, Long.MaxValue, pid, receiverProbe.ref)
List(4, 5) foreach { i receiverProbe.expectMsg(replayedMessage(i)) }

View file

@ -106,10 +106,10 @@ object ValidatePullRequest extends AutoPlugin {
// if this project depends on a modified module, we must test it
deps.nodes.exists { m =>
val depends = modifiedModuleIds exists {
_.name == m.id.name
} // match just by name, we'd rather include too much than too little
if (depends) log.info(s"Project [$name] must be verified, because depends on [${modifiedModuleIds.find(_ == m.id).get}]")
// match just by name, we'd rather include too much than too little
val dependsOnModule = modifiedModuleIds find { _.name == m.id.name }
val depends = dependsOnModule.isDefined
if (depends) log.info(s"Project [$name] must be verified, because depends on [$dependsOnModule]")
depends
}
}