Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316676 - RWT sometimes swallows exceptions from application code
Summary: RWT sometimes swallows exceptions from application code
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.4 M1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: sr131
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-12 04:18 EDT by Rüdiger Herrmann CLA
Modified: 2010-08-31 11:11 EDT (History)
1 user (show)

See Also:


Attachments
Propsed Fix (1.70 KB, patch)
2010-06-12 09:10 EDT, Rüdiger Herrmann CLA
no flags Details | Diff
Bugfix (2.44 KB, patch)
2010-06-15 14:29 EDT, Rüdiger Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rüdiger Herrmann CLA 2010-06-12 04:18:02 EDT
Reproducible with CVS HEAD

If an RWT application throws an exception from within readAndDispatch (i.e. in a listener), the session is left stale and the exception is propagated to the servlet engine. This usually results in an HTTP 500 error page being shown.
Infrequently, the exception is swallowed and an empty response is delivered to the client.

This only applies when running RWT-only, i.e. no JFace/Workbench or other error handling code is present.

When an exception is thrown from the UIThread, it is stored as an attribute in the state-info (IServiceStateInfo) for further processing and the UIThread terminates. Later on, this state-info attribute is read by the request-thread and propagated to the servlet engine. Currently, access to the state-info attribute is unsynchronized which most probably is the reason for this bug.
Comment 1 Rüdiger Herrmann CLA 2010-06-12 09:10:28 EDT
Created attachment 171783 [details]
Propsed Fix

Protects access to ServiceStateInfo members with synchronized blocks
Comment 2 Rüdiger Herrmann CLA 2010-06-15 14:29:38 EDT
Created attachment 171976 [details]
Bugfix

This patch keeps together exception handling (putting the throwable on service-state-info) and switchThread in one sync block.
Comment 3 Rüdiger Herrmann CLA 2010-06-30 02:54:21 EDT
Applied patch #2 to CVS HEAD
Comment 4 Ralf Sternberg CLA 2010-08-31 11:11:16 EDT
Applied patch #2 to 1.3 Maintenance branch