Skip to content

Remove usage of AtomicIntegerFieldUpdater in ReferenceCountedOpenSslE… - #9653

Merged
normanmaurer merged 4 commits into
4.1from
remove_cas
Oct 13, 2019
Merged

normanmaurer merged 4 commits into
4.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

njhill commented Oct 11, 2019

Copy link
Copy Markdown
Member

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

@johnou

johnou commented Oct 12, 2019

Copy link
Copy Markdown
Contributor

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

@njhill njhill left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@johnou

johnou commented Oct 12, 2019 •

Copy link
Copy Markdown
Contributor

@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

@johnou johnou left a comment

Copy link
Copy Markdown
Contributor

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