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

Delaying the setting of requestId till the RequestMessage instantiation time

    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

          Issue Links

            Activity

              People

              • Assignee:
                spmallette stephen mallette
                Reporter:
                euigeun_chung Eugene Chung
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: