Skip to content

Remove usage of AtomicIntegerFieldUpdater in ReferenceCountedOpenSslE…#9653

Merged
normanmaurer merged 4 commits into4.1from
remove_cas
Oct 13, 2019
Merged

Remove usage of AtomicIntegerFieldUpdater in ReferenceCountedOpenSslE…#9653
normanmaurer merged 4 commits into4.1from
remove_cas

Conversation

@normanmaurer
Copy link
Copy Markdown
Member

…ngine

Motivation:

There is not need to use a CAS as everything is synchronized anyway. We can simplify the code a bit by not using it.

Modifications:

  • Just remove the CAS operation
  • Change from int to boolean

Result:

Code cleanup

…ngine

Motivation:

There is not need to use a CAS as everything is synchronized anyway. We can simplify the code a bit by not using it.

Modifications:

- Just remove the CAS operation
- Change from int to boolean

Result:

Code cleanup
@normanmaurer
Copy link
Copy Markdown
Member Author

@njhill you brought this up at some point...

@normanmaurer normanmaurer added this to the 4.1.43.Final milestone Oct 11, 2019
@njhill
Copy link
Copy Markdown
Member

njhill commented Oct 11, 2019

How about this access from wrapped delegated tasks, not sure that it's synchronized?

@johnou
Copy link
Copy Markdown
Contributor

johnou commented Oct 12, 2019

How about this access from wrapped delegated tasks, not sure that it's synchronized?

Guess we keep the field volatile then?

@normanmaurer
Copy link
Copy Markdown
Member Author

@njhill @johnou PTAL again

Copy link
Copy Markdown
Member

@njhill njhill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@johnou
Copy link
Copy Markdown
Contributor

johnou commented Oct 12, 2019

@normanmaurer there's at least one comment referencing DESTROYED_UPDATER which should be updated. Thumbs up to the rest of the diff, it should behave the same as before, that said it looks like there might be a race condition when executing the delegated task where T1 checks destroyed boolean and continues then T2 invokes shutdown concurrently (delegated task running after the ssl engine has been destroyed).. I'm afk right now so I cannot run any local tests.

@normanmaurer
Copy link
Copy Markdown
Member Author

@johnou thats as every access to the engine is guarded and so not a problem when running the delegating task

Copy link
Copy Markdown
Contributor

@johnou johnou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's some bitrot with a comment referencing DESTROYED_UPDATER but the rest lgtm.

@normanmaurer
Copy link
Copy Markdown
Member Author

@johnou yep will fix

@normanmaurer normanmaurer merged commit 833f11b into 4.1 Oct 13, 2019
@normanmaurer normanmaurer deleted the remove_cas branch October 13, 2019 09:02
normanmaurer added a commit that referenced this pull request Oct 13, 2019
#9653)

Motivation:

There is not need to use a CAS as everything is synchronized anyway. We can simplify the code a bit by not using it.

Modifications:

- Just remove the CAS operation
- Change from int to boolean

Result:

Code cleanup
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.

4 participants