Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-1863

Delaying the setting of requestId till the RequestMessage instantiation time

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2.8, 3.3.2
    • Component/s: driver
    • Labels:
      None

      Description

      The Builder class of org.apache.tinkerpop.gremlin.driver.message.RequestMessage class sets its requestId field as UUID.randomUUID() by default.

      But I think it should be fixed not to be set by default. The reasons are below;

      • UUID.randomUUID() uses SecureRandom which grabs the lock at JVM level,
        which means whole threads calling this API compete against each other.
      • Getting random value from SecureRandom is somewhat CPU-intensive job.
      • If a gremlin client sends requestId by itself, the costs above are useless.

      https://lists.apache.org/thread.html/a7e6cfeadad10852a2deed8616e47df6738c13c47119c12f98dcd3e1@%3Cdev.tinkerpop.apache.org%3E

        Attachments

          Activity

            People

            • Assignee:
              spmallette Stephen Mallette
              Reporter:
              euigeun_chung Eugene Chung

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment