Skip to content

Security handshake failed - long queries ( > 2 secs) (nodejs client)  #1905

Description

@pcostell

From @vvzen on January 6, 2017 14:33

Using the google-cloud package, node v 6 and npm-4.0.5 on my local macOS machine (10.11.6).
When performing a query to the datastore sometimes the database would spit it out Security Handshake failed logs (more frequently just after rebooting my express server).
After some seconds (3-4), the query is finally resolved.
The errors all look like this:

E0106 15:08:31.210244000 123145321271296 handshake.c:128] Security handshake failed: {"created":"@1483711711.210211000","description":"Handshake read failed","file":"../src/core/lib/security/transport/handshake.c","file_line":237,"referenced_errors":[{"created":"@1483711711.210204000","description":"FD shutdown","file":"../src/core/lib/iomgr/ev_poll_posix.c","file_line":427}]}

Here's a screenshot (after running a query to check if a user existed) :
security_handshake_error

Copied from original issue: googleapis/google-cloud-datastore#156

Activity

  1. dhermes commented on Jan 6, 2017

    @dhermes
    Contributor

    We've seen the same types of logs leaked from core as well (in google-cloud-python)

  2. added
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    api: datastoreIssues related to the Datastore API.
    on Jan 9, 2017
  3. stephenplusplus commented on Jan 9, 2017

    @stephenplusplus
    Contributor

    grpc/grpc#8839 -- maybe we need to configure a back-off setting when we open a gRPC channel: grpc.initial_reconnect_backoff_ms.

  4. stephenplusplus commented on Jan 23, 2017

    @stephenplusplus
    Contributor

    @jmuk any thoughts on if we should set this value to a higher number for Speech? Or more generally for the other APIs / from another place in the code (gax)?

  5. jmuk commented on Jan 24, 2017

    @jmuk
    Contributor

    Oh, I didn't know the third parameter to the constructors.
    I don't think this is specific to certain APIs, rather I guess it would be up to the connection between user's environment and the google servers. But yeah, setting some default reconnection_backoff (like 10000) on gax makes sense (also possibly the autogen layer should accept customization of these values).

    I am also wondering:

    • what would be the best value in this case?
    • are there any drawbacks when the value gets bigger?

    @murgatroid99 would know the answers, I guess?

  6. stephenplusplus commented on Feb 16, 2017

    @stephenplusplus
    Contributor
  7. murgatroid99 commented on Feb 16, 2017

    @murgatroid99

    Sorry, I don't know the answers to those questions

  8. jmuk commented on Feb 16, 2017

    @jmuk
    Contributor

    In that case, let's leave this value as-is, unspecified.
    When #1991 is fixed, users can specify the parameters by themselves.

  9. stephenplusplus commented on Feb 17, 2017

    @stephenplusplus
    Contributor

    PR sent: #2007, however I specified it as 5000ms instead of the default 1000ms. Users have been having success with 10000ms, but to play it safe, I went in the middle. Happy to set it to any value you think is appropriate.

  10. added a commit that references this issue on Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

api: datastoreIssues related to the Datastore API.coretype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions