这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@codingkarthik
Copy link
Contributor

Description

In #4214, we introduced unlocking of events when graceful shutdown is initiated. This is done by maintaining an in-memory set of locked events. However, after an event has been processed, it's not being removed from the set of locked events. This PR fixes that problem.

Changelog

  • CHANGELOG.md is updated with user-facing content relevant to this PR.

Affected components

  • Server
  • Console
  • CLI
  • Docs
  • Community Content
  • Build System
  • Tests
  • Other (list it)

Related Issues

Solution and Design

Steps to test and verify

Limitations, known bugs & workarounds

Server checklist

Catalog upgrade

Does this PR change Hasura Catalog version?

  • No
  • Yes
    • Updated docs with SQL for downgrading the catalog

Metadata

Does this PR add a new Metadata feature?

  • No
  • Yes
    • Does run_sql auto manages the new metadata through schema diffing?
      • Yes
      • Not required
    • Does run_sql auto manages the definitions of metadata on renaming?
      • Yes
      • Not required
    • Does export_metadata/replace_metadata supports the new metadata added?
      • Yes
      • Not required

GraphQL

  • No new GraphQL schema is generated
  • New GraphQL schema is being generated:
    • New types and typenames are correlated

Breaking changes

  • No Breaking changes

  • There are breaking changes:

    1. Metadata API

      Existing query types:

      • Modify args payload which is not backward compatible
      • Behavioural change of the API
      • Change in response JSON schema
      • Change in error code
    2. GraphQL API

      Schema Generation:

      • Change in any NamedType
      • Change in table field names

      Schema Resolve:-

      • Change in treatment of null value for any input fields
    3. Logging

      • Log JSON schema has changed
      • Log type names have changed

@codingkarthik codingkarthik marked this pull request as ready for review May 29, 2020 10:02
@codingkarthik codingkarthik requested a review from jberryman May 29, 2020 10:02
removeEventFromLockedEvents eventId = do
liftIO $ atomically $ do
lockedEvents <- readTVar _eeCtxLockedEvents
writeTVar _eeCtxLockedEvents $ Set.delete eventId lockedEvents
Copy link
Collaborator

@jberryman jberryman Jun 1, 2020

Choose a reason for hiding this comment

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

It's probably fine, but can you add a strictness annotation here?:

writeTVar _eeCtxLockedEvents $! Set.delete eventId lockedEvents
                              ^

I'm always a little worried about writing thunks to mutable variables

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yes..I didn't realize that I'm writing a thunk to a mutable variable. I will also change it where we are saving the locked events.

Copy link
Collaborator

@jberryman jberryman left a comment

Choose a reason for hiding this comment

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

This LGTM except for the $! if you agree.

@hasura-bot
Copy link
Contributor

Review app for commit 78f9444 deployed to Heroku: https://hge-ci-pull-4932.herokuapp.com
Docker image for server: hasura/graphql-engine:pull4932-78f94444

@hasura-bot
Copy link
Contributor

Review app for commit 2aec3ce deployed to Heroku: https://hge-ci-pull-4932.herokuapp.com
Docker image for server: hasura/graphql-engine:pull4932-2aec3ced

@codingkarthik codingkarthik merged commit 81f338c into hasura:master Jun 2, 2020
@hasura-bot
Copy link
Contributor

Review app https://hge-ci-pull-4932.herokuapp.com is deleted

stevefan1999-personal pushed a commit to stevefan1999-personal/graphql-engine that referenced this pull request Sep 12, 2020
…#4932)

* remove event from the saved locked events after processing it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants