google-nomulus/java/google/registry
nickfelt 01698059f6 Fix flow double-init bug by removing @FlowScope on provideFlow()
See [] for details, but basically, @FlowScope causes the Flow instance produced by flowProvider.get() in FlowRunner to be the same each time it's called, which leads to the instance being re-used when a transactional retry (e.g. for a ConcurrentModificationException) causes a flow to be attempted more than once.  Flow is not meant to be re-used and certain flows fail at runtime when this happens, so the effect is that a CME now aborts most EPP requests, which is bad.

This is a bit of a hacky fix; finding a better one is tracked in []

== TESTING ==
This is very hard to test because there isn't really a clean way to trigger a CME from within a flow's execution without hardcoding in assumptions about what a given flow is doing when it runs, and we can't easily supply a custom Flow for testing while also exercising the Flow daggerization process (since this bug only appears due to the specific way that dagger constructs the Provider<Flow>).  Ideally a fix would improve the testability here as well.

For now, I've manually tested this change by pasting code into FlowRunner that explicitly throws a ConcurrentModificationException after running the flow (similar to DryRunException), but only on the first transaction attempt.  With @FlowScope on provideFlow(), this change reproduces the UnsupportedOperationException issue in many tests; once it's removed (i.e. with this CL submitted) the problem goes away.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126226066
2016-07-01 13:36:15 -04:00
..
backup Rename Java packages to use the .google TLD 2016-05-13 20:04:42 -04:00
bigquery Replace nested @Multibindings interfaces with the new @Multibinds feature. See [] 2016-06-27 16:37:42 -04:00
billing Fix minor items on recurring billing expansion MR 2016-07-01 13:32:17 -04:00
braintree Rename Java packages to use the .google TLD 2016-05-13 20:04:42 -04:00
config Add configurable escrow file import GCS bucket 2016-06-06 13:31:10 -04:00
cron Rename Java packages to use the .google TLD 2016-05-13 20:04:42 -04:00
dns Migrate @Provides methods to @Binds methods where possible. 2016-06-27 16:47:18 -04:00
eclipse Integrate: Eclipse file generation script 2016-05-16 18:39:45 -04:00
env Add MR to expand billing events into OneTimes 2016-06-14 16:31:00 -04:00
export Fix latest_snapshot "pointer" query to use to fully-qualified table reference 2016-06-27 16:09:10 -04:00
flows Fix flow double-init bug by removing @FlowScope on provideFlow() 2016-07-01 13:36:15 -04:00
gcs Rename Java packages to use the .google TLD 2016-05-13 20:04:42 -04:00
groups Migrate @Provides methods to @Binds methods where possible. 2016-06-27 16:47:18 -04:00
idn Rename Java packages to use the .google TLD 2016-05-13 20:04:42 -04:00
keyring/api Rename Java packages to use the .google TLD 2016-05-13 20:04:42 -04:00
loadtest Make open source build pass 2016-06-14 16:33:56 -04:00
mapreduce Add scaffolding of deeplinking verification [] 2016-06-06 12:11:59 -04:00
model Add XjcToContactResourceConverter 2016-07-01 11:38:05 -04:00
module Fix minor items on recurring billing expansion MR 2016-07-01 13:32:17 -04:00
monitoring/whitebox Format EppMetrics a bit nicer 2016-06-27 15:59:16 -04:00
pricing Rename PricingEngine to PremiumPricingEngine 2016-06-14 16:29:52 -04:00
rdap Registrant of a domain can never be null 2016-05-18 13:10:18 -04:00
rde Add XjcToContactResourceConverter 2016-07-01 11:38:05 -04:00
request Migrate @Provides methods to @Binds methods where possible. 2016-06-27 16:47:18 -04:00
security Make javadoc <p> style guide compliant 2016-05-18 13:09:01 -04:00
storage/drive Rename Java packages to use the .google TLD 2016-05-13 20:04:42 -04:00
tldconfig/idn Prefer re2 over java.util.regex 2016-05-13 23:16:07 -04:00
tmch Make javadoc <p> style guide compliant 2016-05-18 13:09:01 -04:00
tools Migrate @Provides methods to @Binds methods where possible. 2016-06-27 16:47:18 -04:00
ui Turn CheckApiAction into a standard-ish epp endpoint 2016-06-27 16:22:12 -04:00
util Add XjcToContactResourceConverter 2016-07-01 11:38:05 -04:00
whois Remove unused and misused methods from EppResourceUtils and DomainBase. 2016-05-16 18:39:23 -04:00
xjc Fix generics in EppXmlTransformer.unmarshal to not be only on the return type. 2016-06-27 15:55:03 -04:00
xml Fix generics in EppXmlTransformer.unmarshal to not be only on the return type. 2016-06-27 15:55:03 -04:00
BUILD Make new source tree visible from internal release files 2016-05-13 23:16:01 -04:00
repositories.bzl Upgrade apache_sshd CL #2: Update to v1_2_0 2016-06-27 16:41:48 -04:00