[
https://issues.apache.org/jira/browse/IVY-492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12495633
]
Geoff Reedy commented on IVY-492:
---------------------------------
FYI, I have ported the changed that my 1.4 patch does to the 2.0 code.
However, the patch is at home and I am at work. I will try to remember to post
it to this issue when I get home tonight.
My 1.4 patch actually did create an additional interface called
TransactionalResolver, but for 2.0 I added them directly to the
DependencyResolver interface. Perhaps my reasons for the choices I made each
time will be helpful.
When I was writing my patch for 1.4 I wanted as little intrusion into the rest
of the ivy code as possible so I created an additional interface and
implemented it in my resolver. Thus, the only ivy code I had to modify were
the publish and install methods of the Ivy class. This made my patch smaller
since I didn't have to worry about adding those methods to any other resolvers.
However, the change would have been simpler if I could have depended on the
DependencyResolver interface having the transaction methods which is the path I
took porting my patch to the 2.0 code. I think it also makes use of the
DependencyResolver interface easier since you can see right away that there are
transactional methods that should be used when calling the publish method. In
my patch I have at home I added no-op implementations of the transaction
methods to AbstractResolver so that none of the resolvers already provided need
to be changed.
Regarding the transactional attribute, should a publish with missing artifacts
ever be considered successful? It would seem that a more reasonable behavior
would be to raise a MissingArtifactsException that contains the list of missing
artifacts rather than returning that collection from the publish methods.
Though serious thoughts about changing that (if it isn't already too late for
the 2.0 timeframe) should probably go to a new JIRA issue.
> support atomic publish operation
> --------------------------------
>
> Key: IVY-492
> URL: https://issues.apache.org/jira/browse/IVY-492
> Project: Ivy
> Issue Type: New Feature
> Components: Core
> Reporter: Geoff Reedy
>
> Some resolver types (e.g. one that uses subversion) could benefit from
> publishing a module as a single atomic transaction. Currently, each artifact
> (and it's checksums) are published as separate operations, if one of the
> artifact uploads fail (perhaps an artifact is missing or another user is
> trying to publish the same version at the same time) the ivy repository can
> be in an inconsistent state with a half published module. In addition, if
> uploads are logged many entries in the log are generated for a single logical
> operation.
> A possible implementation strategy is to add three new methods to the
> resolver interface:
> beginPublish(ModuleRevisionId)
> abortPublish()
> commitPublish()
> beginPublish would be called before publishing the artifacts of the module,
> abortPublish would be called if there is an error while publishing the
> module, commitPublish would be called if all artifacts were successfully
> published. Existing resolvers could simple implement these methods as no-ops
> to retain the present behavior.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.