Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Thread safety in HttpProtocol when concurrent = true #491

@fmontesi

Description

@fmontesi

In HttpProtocol, we have the following thread-unsafe fields:

	// FIXME the following fields need to be made thread-safe
	private String inputId = null;
	private MultiPartFormDataParser multiPartFormDataParser = null;
	private String encoding = null;
	private String requestFormat = null;
	private String requestCharset = null;
	private boolean headRequest = false;

This is a problem when isThreadSafe() == true because of data races when dealing with concurrent HTTP requests.

@mwallnoefer would it be possible to at least group all of these parameters into an enclosing object (a private HttpExchangeContext class or something like that?). That way we can start either:

  • Deactivating content negotiation & co. when isThreadSafe() == true; or, even better,
  • Have a concurrent hashmap to keep track of these context objects per request id.

Metadata

Metadata

Labels

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions