Last-minute critical bug report

77 views
Skip to first unread message

Thomas Broyer

unread,
Sep 13, 2012, 8:02:18 AM9/13/12
to google-web-tool...@googlegroups.com, unn...@google.com
Found on StackOverflow: http://stackoverflow.com/q/12403658/116472

We have a critical issue with RequestFactory (AutoBeans actually): we use static HashMaps as shared caches without any synchronization!

Short-term fix: because neither ConcurrentHashMap or Collections.synchronizedMap are emulated (and this is in shared code), add objects (new Object()) and synchronized blocks around accesses to those maps.
Long-term fix: we should probably emulate ConcurrentHashMap and/or Collections.synchronizedMap as "no-ops" (ConcurrentHashMap has a simple wrapper around HashMap or something similar, and Collections.synchronizedMap returning its argument unchanged; I don't know yet what should be used here, as I haven't yet looked closely at the code that makes use of these static maps)

Alternatively, we could emulate Collections.synchronizedXxx methods as no-ops and use that in AutoBeans with synchronized blocks, as a short/middle-term fix (or maybe long-term too).

And by short-term I mean 2.5.0. Do you think it would be possible?
(and by possible, I mean: if I send a patch later today, are there chances it'll be integrated into RC2?)

John A. Tamplin

unread,
Sep 13, 2012, 9:33:43 AM9/13/12
to google-web-tool...@googlegroups.com, unn...@google.com

Yeah, just add a synchronized block for now.

John A. Tamplin (android)

Unnur Gretarsdottir

unread,
Sep 13, 2012, 11:33:32 AM9/13/12
to John A. Tamplin, google-web-tool...@googlegroups.com

Yes - we can put it into rc2 assuming its small and you can get it in today.

Reply all
Reply to author
Forward
0 new messages