Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Frame instance was referenced longer than required.#88

Merged
stevegury merged 1 commit intorsocket:masterrsocket/rsocket-java:masterfrom
NiteshKant:frame-refNiteshKant/reactivesocket-java:frame-refCopy head branch name to clipboard
Jun 3, 2016
Merged

Frame instance was referenced longer than required.#88
stevegury merged 1 commit intorsocket:masterrsocket/rsocket-java:masterfrom
NiteshKant:frame-refNiteshKant/reactivesocket-java:frame-refCopy head branch name to clipboard

Conversation

@NiteshKant
Copy link
Contributor

Problem:

handleXXX methods in Responder were closing over the passed requestFrame and using it later in the lifecycle of request processing.
Frame objects and the underlying buffers are not designed to be retained after the scope of the parent method as these objects are threadlocal and reused. This causes issues when the frame object is referenced later in the request processing (eg: cleanup())

Solution:

The only reason frame object was retained was to get the stream Id. This change pre-fetches the streamId and uses that from within the processing closure.

Result:

No more issue with frame access.

Problem:

`handleXXX` methods in `Responder` were closing over the passed `requestFrame` and using it later in the lifecycle of request processing.
 `Frame` objects and the underlying buffers are not designed to be retained after the scope of the parent method as these objects are threadlocal and reused. This causes issues when the frame object is referenced later in the request processing (eg: `cleanup()`)

 Solution:

 The only reason frame object was retained was to get the stream Id. This change pre-fetches the `streamId` and uses that from within the processing closure.

 Result:

 No more issue with frame access.
@stevegury
Copy link
Member

👍 This looks good, thanks for the fix!

@stevegury stevegury merged commit f62e73d into rsocket:master Jun 3, 2016
@NiteshKant NiteshKant deleted the frame-ref branch June 19, 2016 05:05
ilayaperumalg pushed a commit to ilayaperumalg/rsocket-java that referenced this pull request Dec 26, 2017
US Typo and reword the frame length requirements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.