Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server handler state machine #1396

Conversation

glbrntt
Copy link
Collaborator

@glbrntt glbrntt commented May 3, 2022

Motivation:

See #1394.

Modifications:

  • Add a 'ServerHandlerStateMachine' and tests.
  • This is not used anywhere (yet).

Result:

Handler state machine is in place.

Motivation:

See grpc#1394.

Modifications:

- Add a 'ServerHandlerStateMachine' and tests.
- This is not used anywhere (yet).

Result:

Handler state machine is in place.
Copy link
Collaborator

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

Basically good, one question.

case drop
}

enum SendStatusAction: Equatable {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are these not Hashable for a reason?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Only because HPACKHeaders is not Hashable.

We don't really need Equatable or Hashable here, but it's useful for testing.

@glbrntt glbrntt merged commit 9fdb653 into grpc:1.7.1-async-await May 4, 2022
@glbrntt glbrntt deleted the gb-async-handler-handler-state-machine branch May 4, 2022 09:44
glbrntt added a commit to glbrntt/grpc-swift that referenced this pull request May 11, 2022
Motivation:

In grpc#1394 and grpc#1396 we introduced new state machines for the server
interceptors and handler. This change updates the async server handler
to make use of them.

Modifications:

- Add the relevant `@inlinable` and `@usableFromInline` annotations to
  both state machines.
- Refactor the async server handler to use both state machines.
- Refactor async handler tests to use a 'real' event loop; the previous
  mix of embedded and async was unsafe.
- Re-enable TSAN

Result:

- Better separation between interceptors and user func
- TSAN is happier
- Resolves grpc#1362
glbrntt added a commit to glbrntt/grpc-swift that referenced this pull request May 11, 2022
Motivation:

In grpc#1394 and grpc#1396 we introduced new state machines for the server
interceptors and handler. This change updates the async server handler
to make use of them.

Modifications:

- Add the relevant `@inlinable` and `@usableFromInline` annotations to
  both state machines.
- Refactor the async server handler to use both state machines.
- Refactor async handler tests to use a 'real' event loop; the previous
  mix of embedded and async was unsafe.
- Re-enable TSAN

Result:

- Better separation between interceptors and user func
- TSAN is happier
- Resolves grpc#1362
glbrntt added a commit that referenced this pull request May 16, 2022
Motivation:

In #1394 and #1396 we introduced new state machines for the server
interceptors and handler. This change updates the async server handler
to make use of them.

Modifications:

- Add the relevant `@inlinable` and `@usableFromInline` annotations to
  both state machines.
- Refactor the async server handler to use both state machines.
- Refactor async handler tests to use a 'real' event loop; the previous
  mix of embedded and async was unsafe.
- Re-enable TSAN

Result:

- Better separation between interceptors and user func
- TSAN is happier
- Resolves #1362
@glbrntt glbrntt added the 🔨 semver/patch No public API change. label Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants