Skip to content

Make only default IdleStateEvents cached string representation#9705

Merged
normanmaurer merged 1 commit intonetty:4.1from
carl-mastrangelo:noread
Oct 24, 2019
Merged

Make only default IdleStateEvents cached string representation#9705
normanmaurer merged 1 commit intonetty:4.1from
carl-mastrangelo:noread

Conversation

@carl-mastrangelo
Copy link
Copy Markdown
Member

@carl-mastrangelo carl-mastrangelo commented Oct 24, 2019

Motivation:

In PR #9695 IdleStateEvents
were made to cache their string representation. The reason for this
was to avoid creating garbage as these values would be used frequently.
However, these objects may be used on multiple event loops and this
may cause an unexpected race to occur.

Modification:
Only make the events that Netty creates cache their toString representation.

Result:
No races.

@netty-bot
Copy link
Copy Markdown

Can one of the admins verify this patch?

@carl-mastrangelo
Copy link
Copy Markdown
Member Author

@ursaj fyi

Motivation:

In PR netty#9695   IdleStateEvents
were made to cache their string representation.   The reason for this
was to avoid creating garbage as these values would be used frequently.
However, these objects may be used on multiple event loops and this
may cause an unexpected race to occur.

Modification:
Only make the events that Netty creates cache their toString representation.

Result:
No races.
@normanmaurer
Copy link
Copy Markdown
Member

@netty-bot test this please

@normanmaurer normanmaurer merged commit ff9df03 into netty:4.1 Oct 24, 2019
@normanmaurer
Copy link
Copy Markdown
Member

@carl-mastrangelo makes sense... thanks

@normanmaurer normanmaurer added this to the 4.1.43.Final milestone Oct 24, 2019
normanmaurer pushed a commit that referenced this pull request Oct 24, 2019
Motivation:

In PR #9695   IdleStateEvents
were made to cache their string representation.   The reason for this
was to avoid creating garbage as these values would be used frequently.
However, these objects may be used on multiple event loops and this
may cause an unexpected race to occur.

Modification:
Only make the events that Netty creates cache their toString representation.

Result:
No races.
@carl-mastrangelo carl-mastrangelo deleted the noread branch October 24, 2019 06:53
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.

3 participants