(tinkerpop) 01/01: Merge branch '3.7-dev'

2024-06-17 Thread kenhuuu
This is an automated email from the ASF dual-hosted git repository.

kenhuuu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit e84e749ef2d4d376a6c7806c19b36913de81bf95
Merge: 13cab682f4 edec67ff15
Author: Ken Hu <106191785+kenh...@users.noreply.github.com>
AuthorDate: Mon Jun 17 13:17:06 2024 -0700

Merge branch '3.7-dev'

 CHANGELOG.asciidoc| 1 +
 .../tinkerpop/gremlin/process/traversal/step/filter/CoinStep.java | 4 
 2 files changed, 5 insertions(+)




(tinkerpop) branch master updated (13cab682f4 -> e84e749ef2)

2024-06-17 Thread kenhuuu
This is an automated email from the ASF dual-hosted git repository.

kenhuuu pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git


from 13cab682f4 Merge branch '3.7-dev'
 add db4c0ff92f add getter method for CoinStep#probability
 add edec67ff15 Merge pull request #2654
 new e84e749ef2 Merge branch '3.7-dev'

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 CHANGELOG.asciidoc| 1 +
 .../tinkerpop/gremlin/process/traversal/step/filter/CoinStep.java | 4 
 2 files changed, 5 insertions(+)



Re: [PR] add getter method for CoinStep#probability [tinkerpop]

2024-06-17 Thread via GitHub


kenhuuu merged PR #2654:
URL: https://github.com/apache/tinkerpop/pull/2654


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



(tinkerpop) 01/01: Merge pull request #2654

2024-06-17 Thread kenhuuu
This is an automated email from the ASF dual-hosted git repository.

kenhuuu pushed a commit to branch 3.7-dev
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit edec67ff15eece69db054785b625224bb238a266
Merge: 05ad0f3817 db4c0ff92f
Author: kenhuuu <106191785+kenh...@users.noreply.github.com>
AuthorDate: Mon Jun 17 13:16:14 2024 -0700

Merge pull request #2654

add getter method for CoinStep#probability

 CHANGELOG.asciidoc| 1 +
 .../tinkerpop/gremlin/process/traversal/step/filter/CoinStep.java | 4 
 2 files changed, 5 insertions(+)



(tinkerpop) branch 3.7-dev updated (05ad0f3817 -> edec67ff15)

2024-06-17 Thread kenhuuu
This is an automated email from the ASF dual-hosted git repository.

kenhuuu pushed a change to branch 3.7-dev
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git


from 05ad0f3817 Merge pull request #2652
 add db4c0ff92f add getter method for CoinStep#probability
 new edec67ff15 Merge pull request #2654

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 CHANGELOG.asciidoc| 1 +
 .../tinkerpop/gremlin/process/traversal/step/filter/CoinStep.java | 4 
 2 files changed, 5 insertions(+)



Re: [PR] add getter method for CoinStep#probability [tinkerpop]

2024-06-17 Thread via GitHub


kenhuuu commented on PR #2654:
URL: https://github.com/apache/tinkerpop/pull/2654#issuecomment-2174345482

   VOTE +1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Python driver basic connectivity to HTTP server [tinkerpop]

2024-06-17 Thread via GitHub


vkagamlyk commented on code in PR #2657:
URL: https://github.com/apache/tinkerpop/pull/2657#discussion_r1643330187


##
gremlin-python/src/main/python/gremlin_python/structure/io/util.py:
##
@@ -58,3 +61,38 @@ def of(cls, o):
 new_o[k] = cls.of(v)
 return new_o
 
+
+# referenced python singleton from 
https://refactoring.guru/design-patterns/singleton/python/example#example-1--main-py,
+# might need some refactoring
+class SingletonMeta(type):
+
+_instances = {}
+_lock: Lock = Lock()
+
+def __call__(cls, *args, **kwargs):
+with cls._lock:
+if cls not in cls._instances:
+instance = super().__call__(*args, **kwargs)
+cls._instances[cls] = instance
+return cls._instances[cls]
+
+
+class Marker(metaclass=SingletonMeta):
+_value: SingleByte
+
+def __init__(self, value: SingleByte) -> None:
+self._value = value
+
+@staticmethod
+def end_of_stream():
+return Marker(SingleByte(0))
+
+def get_value(self):
+return self._value
+
+@classmethod
+def of(cls, val):

Review Comment:
   GLV should be able to only read Marker, not send



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Python driver basic connectivity to HTTP server [tinkerpop]

2024-06-17 Thread via GitHub


vkagamlyk commented on code in PR #2657:
URL: https://github.com/apache/tinkerpop/pull/2657#discussion_r1643330187


##
gremlin-python/src/main/python/gremlin_python/structure/io/util.py:
##
@@ -58,3 +61,38 @@ def of(cls, o):
 new_o[k] = cls.of(v)
 return new_o
 
+
+# referenced python singleton from 
https://refactoring.guru/design-patterns/singleton/python/example#example-1--main-py,
+# might need some refactoring
+class SingletonMeta(type):
+
+_instances = {}
+_lock: Lock = Lock()
+
+def __call__(cls, *args, **kwargs):
+with cls._lock:
+if cls not in cls._instances:
+instance = super().__call__(*args, **kwargs)
+cls._instances[cls] = instance
+return cls._instances[cls]
+
+
+class Marker(metaclass=SingletonMeta):
+_value: SingleByte
+
+def __init__(self, value: SingleByte) -> None:
+self._value = value
+
+@staticmethod
+def end_of_stream():
+return Marker(SingleByte(0))
+
+def get_value(self):
+return self._value
+
+@classmethod
+def of(cls, val):

Review Comment:
   GLV should be able to only read Marker, not send



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Python driver basic connectivity to HTTP server [tinkerpop]

2024-06-17 Thread via GitHub


vkagamlyk commented on code in PR #2657:
URL: https://github.com/apache/tinkerpop/pull/2657#discussion_r1643294757


##
gremlin-python/src/main/python/gremlin_python/driver/serializer.py:
##
@@ -292,3 +295,96 @@ def deserialize_message(self, message):
   'data': result}}
 
 return msg
+
+
+"""
+GraphBinaryV4
+"""
+class GraphBinarySerializersV4(object):
+DEFAULT_READER_CLASS = graphbinaryV4.GraphBinaryReader
+DEFAULT_WRITER_CLASS = graphbinaryV4.GraphBinaryWriter
+DEFAULT_VERSION = b"application/vnd.graphbinary-v4.0"
+
+max_int64 = 0x
+header_struct = struct.Struct('>b32sBQQ')
+header_pack = header_struct.pack
+int_pack = graphbinaryV4.int32_pack
+int32_unpack = struct.Struct(">i").unpack
+
+def __init__(self, reader=None, writer=None, version=None):
+if not version:
+version = self.DEFAULT_VERSION
+self._version = version
+if not reader:
+reader = self.DEFAULT_READER_CLASS()
+self._graphbinary_reader = reader
+if not writer:
+writer = self.DEFAULT_WRITER_CLASS()
+self._graphbinary_writer = writer
+
+@property
+def version(self):
+"""Read only property"""
+return self._version
+
+def serialize_message(self, request_message):
+message = self.build_message(request_message.fields, 
request_message.gremlin)
+return message
+
+def build_message(self, fields, gremlin):
+message = {
+'fields': fields,
+'gremlin': gremlin
+}
+return self.finalize_message(message, 0x20, self.version)
+
+def finalize_message(self, message, mime_len, mime_type):

Review Comment:
   nit: mime_len and mime_type are no longer part of request



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Python driver basic connectivity to HTTP server [tinkerpop]

2024-06-17 Thread via GitHub


vkagamlyk commented on code in PR #2657:
URL: https://github.com/apache/tinkerpop/pull/2657#discussion_r1643290214


##
gremlin-server/conf/gremlin-server-modern.yaml:
##
@@ -28,9 +29,9 @@ scriptEngines: {
org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: 
{classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: 
{files: [scripts/generate-modern.groovy]
 serializers:
-  - { className: 
org.apache.tinkerpop.gremlin.util.ser.GraphSONMessageSerializerV3, config: { 
ioRegistries: 
[org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3] }}  
  # application/json
-  - { className: 
org.apache.tinkerpop.gremlin.util.ser.GraphBinaryMessageSerializerV1 }  

 # application/vnd.graphbinary-v1.0
-  - { className: 
org.apache.tinkerpop.gremlin.util.ser.GraphBinaryMessageSerializerV1, config: { 
serializeResultToString: true }}
 # application/vnd.graphbinary-v1.0-stringd
+  - { className: 
org.apache.tinkerpop.gremlin.util.ser.GraphSONMessageSerializerV4, config: { 
ioRegistries: 
[org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3] }}  
  # application/json
+  - { className: 
org.apache.tinkerpop.gremlin.util.ser.GraphBinaryMessageSerializerV4 }  

 # application/vnd.graphbinary-v1.0
+  - { className: 
org.apache.tinkerpop.gremlin.util.ser.GraphBinaryMessageSerializerV4, config: { 
serializeResultToString: true }}
 # application/vnd.graphbinary-v1.0-stringd

Review Comment:
   need to keep only single GraphBinaryMessageSerializerV4



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



(tinkerpop) 01/01: Update profiling with latency test

2024-06-17 Thread kenhuuu
This is an automated email from the ASF dual-hosted git repository.

kenhuuu pushed a commit to branch 370-profiling
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit 5e3d8eca62383a9402ec25f24cd8b896053964a0
Author: Ken Hu <106191785+kenh...@users.noreply.github.com>
AuthorDate: Sat Jun 15 13:04:27 2024 -0700

Update profiling with latency test
---
 .../gremlin/driver/util/ProfilingApplication.java  | 132 -
 1 file changed, 100 insertions(+), 32 deletions(-)

diff --git 
a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/util/ProfilingApplication.java
 
b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/util/ProfilingApplication.java
index 4259e2545f..c1fbc7f69f 100644
--- 
a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/util/ProfilingApplication.java
+++ 
b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/util/ProfilingApplication.java
@@ -30,7 +30,9 @@ import java.io.BufferedWriter;
 import java.io.File;
 import java.io.FileWriter;
 import java.io.PrintWriter;
+import java.util.Iterator;
 import java.util.Map;
+import java.util.NoSuchElementException;
 import java.util.Random;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
@@ -48,7 +50,7 @@ import java.util.stream.IntStream;
  */
 public class ProfilingApplication {
 
-private static final Random random = new Random();
+private static final Random random = new Random(0);
 private static final String[] scripts = new String[]{
 "g.V()",
 "g.V(1).out('knows')",
@@ -87,7 +89,7 @@ public class ProfilingApplication {
 this.exercise = exercise;
 }
 
-public long execute() throws Exception {
+public long executeThroughput() throws Exception {
 final AtomicInteger tooSlow = new AtomicInteger(0);
 
 final Client client = cluster.connect();
@@ -130,16 +132,53 @@ public class ProfilingApplication {
 }
 }
 
+public double executeLatency() throws Exception {
+final Client client = cluster.connect();
+final String executionId = "[" + executionName + "]";
+try {
+client.init();
+
+long total = 0;
+
+final long start = System.nanoTime();
+int size = 0;
+final Iterator itr = client.submitAsync(script).get().iterator();
+try {
+while (true) {
+itr.next();
+size++;
+}
+} catch (NoSuchElementException nsee) {
+; // Expected as hasNext() not called to increase performance.
+}
+final long end = System.nanoTime();
+total += (end - start);
+
+
+final double totalSeconds = total / 10d;
+System.out.println(String.format(StringUtils.rightPad(executionId, 
10) + "time: %s, result count: %s", 
StringUtils.rightPad(String.valueOf(totalSeconds), 7), 
StringUtils.rightPad(String.valueOf(size), 10)));
+return totalSeconds;
+} catch (Exception ex) {
+ex.printStackTrace();
+throw new RuntimeException(ex);
+} finally {
+client.close();
+}
+}
+
 private String chooseScript() {
 return scripts[random.nextInt(scripts.length - 1)];
 }
 
+public enum TestType { UNKNOWN, LATENCY, THROUGHPUT };
+
 public static void main(final String[] args) {
 final Map options = ElementHelper.asMap(args);
 final boolean noExit = 
Boolean.parseBoolean(options.getOrDefault("noExit", "false").toString());
 final int parallelism = 
Integer.parseInt(options.getOrDefault("parallelism", "16").toString());
 final BasicThreadFactory threadFactory = new 
BasicThreadFactory.Builder().namingPattern("profiler-%d").build();
 final ExecutorService executor = 
Executors.newFixedThreadPool(parallelism, threadFactory);
+final TestType testType = 
TestType.values()[(Integer.parseInt(options.getOrDefault("testType", 
"2").toString()) % TestType.values().length)];
 
 final String host = options.getOrDefault("host", 
"localhost").toString();
 final int minExpectedRps = 
Integer.parseInt(options.getOrDefault("minExpectedRps", "1000").toString());
@@ -155,7 +194,7 @@ public class ProfilingApplication {
 final int maxInProcessPerConnection = 
Integer.parseInt(options.getOrDefault("maxInProcessPerConnection", 
"64").toString());
 final int minInProcessPerConnection = 
Integer.parseInt(options.getOrDefault("minInProcessPerConnection", 
"16").toString());
 final int maxWaitForConnection = 
Integer.parseInt(options.getOrDefault("maxWaitForConnection", 
"3000").toString());
-final int workerPoolSize = 
Integer.parseInt(options.getOrDefault("workerPoolSize", "2").toString());
+final int workerPoolSize = 
Integer.parseInt(options.getOrDefault("

(tinkerpop) branch 370-profiling created (now 5e3d8eca62)

2024-06-17 Thread kenhuuu
This is an automated email from the ASF dual-hosted git repository.

kenhuuu pushed a change to branch 370-profiling
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git


  at 5e3d8eca62 Update profiling with latency test

This branch includes the following new commits:

 new 5e3d8eca62 Update profiling with latency test

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




(tinkerpop) 02/02: Update profiling app

2024-06-17 Thread kenhuuu
This is an automated email from the ASF dual-hosted git repository.

kenhuuu pushed a commit to branch master-http-profiling
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit 45de8aa2ed58ec17580fc252f77e06e5ec12bae5
Author: Ken Hu <106191785+kenh...@users.noreply.github.com>
AuthorDate: Mon Jun 17 11:28:27 2024 -0700

Update profiling app
---
 .../tinkerpop/gremlin/driver/util/ProfilingApplication.java   | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git 
a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/util/ProfilingApplication.java
 
b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/util/ProfilingApplication.java
index 1df5896d5f..d4a4fb109f 100644
--- 
a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/util/ProfilingApplication.java
+++ 
b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/util/ProfilingApplication.java
@@ -187,9 +187,9 @@ public class ProfilingApplication {
 final int executions = 
Integer.parseInt(options.getOrDefault("executions", "10").toString());
 final int nioPoolSize = 
Integer.parseInt(options.getOrDefault("nioPoolSize", "1").toString());
 final int requests = Integer.parseInt(options.getOrDefault("requests", 
"1").toString());
-final int minConnectionPoolSize = 
Integer.parseInt(options.getOrDefault("minConnectionPoolSize", 
"256").toString());
-final int maxConnectionPoolSize = 
Integer.parseInt(options.getOrDefault("maxConnectionPoolSize", 
"256").toString());
-final int maxWaitForConnection = 
Integer.parseInt(options.getOrDefault("maxWaitForConnection", 
"3000").toString());
+final int minConnectionPoolSize = 
Integer.parseInt(options.getOrDefault("minConnectionPoolSize", 
"128").toString());
+final int maxConnectionPoolSize = 
Integer.parseInt(options.getOrDefault("maxConnectionPoolSize", 
"1024").toString());
+final int maxWaitForConnection = 
Integer.parseInt(options.getOrDefault("maxWaitForConnection", 
"30").toString());
 final int workerPoolSize = 
Integer.parseInt(options.getOrDefault("workerPoolSize", 
Runtime.getRuntime().availableProcessors() * 2).toString());
 final int tooSlowThreshold = 
Integer.parseInt(options.getOrDefault("tooSlowThreshold", "125").toString());
 final String serializer = options.getOrDefault("serializer", 
SerializersV4.GRAPHBINARY_V4.name()).toString();
@@ -198,6 +198,7 @@ public class ProfilingApplication {
 final String script = options.getOrDefault("script", "1+1").toString();
 
 final Cluster cluster = Cluster.build(host)
+.maxContentLength(Integer.MAX_VALUE)
 .minConnectionPoolSize(minConnectionPoolSize)
 .maxConnectionPoolSize(maxConnectionPoolSize)
 .nioPoolSize(nioPoolSize)
@@ -223,7 +224,7 @@ public class ProfilingApplication {
 final File f = null == fileName ? null : new 
File(fileName.toString());
 if (f != null && f.length() == 0) {
 try (final PrintWriter writer = new PrintWriter(new 
BufferedWriter(new FileWriter(f, true {
-
writer.println("parallelism\tnioPoolSize\tminConnectionPoolSize\tmaxConnectionPoolSize\tminSimultaneousUsagePerConnection\tmaxSimultaneousUsagePerConnection\tminInProcessPerConnection\tmaxInProcessPerConnection\tworkerPoolSize\trequestPerSecond");
+
writer.println("parallelism\tnioPoolSize\tminConnectionPoolSize\tmaxConnectionPoolSize\tworkerPoolSize\trequestPerSecond");
 }
 }
 
@@ -254,7 +255,7 @@ public class ProfilingApplication {
 System.out.println(String.format("avg req/sec: %s", 
averageRequestPerSecond));
 if (f != null) {
 try (final PrintWriter writer = new PrintWriter(new 
BufferedWriter(new FileWriter(f, true {
-writer.println(String.join("\t", 
String.valueOf(parallelism), String.valueOf(nioPoolSize), 
String.valueOf(minConnectionPoolSize), String.valueOf(maxConnectionPoolSize), 
String.valueOf(minSimultaneousUsagePerConnection), 
String.valueOf(maxSimultaneousUsagePerConnection), 
String.valueOf(minInProcessPerConnection), 
String.valueOf(maxInProcessPerConnection), String.valueOf(workerPoolSize), 
String.valueOf(averageRequestPerSecond)));
+writer.println(String.join("\t", 
String.valueOf(parallelism), String.valueOf(nioPoolSize), 
String.valueOf(minConnectionPoolSize), String.valueOf(maxConnectionPoolSize), 
String.valueOf(workerPoolSize), String.valueOf(averageRequestPerSecond)));
 }
 }
 } else if (TestType.LATENCY == testType) {



(tinkerpop) branch master-http-profiling created (now 45de8aa2ed)

2024-06-17 Thread kenhuuu
This is an automated email from the ASF dual-hosted git repository.

kenhuuu pushed a change to branch master-http-profiling
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git


  at 45de8aa2ed Update profiling app

This branch includes the following new commits:

 new f80bfb5e02 Update profiling with latency test
 new 45de8aa2ed Update profiling app

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




(tinkerpop) 01/02: Update profiling with latency test

2024-06-17 Thread kenhuuu
This is an automated email from the ASF dual-hosted git repository.

kenhuuu pushed a commit to branch master-http-profiling
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit f80bfb5e02f19eed6b27b5a8e646f48978157153
Author: Ken Hu <106191785+kenh...@users.noreply.github.com>
AuthorDate: Sat Jun 15 13:04:27 2024 -0700

Update profiling with latency test
---
 .../gremlin/driver/util/ProfilingApplication.java  | 132 -
 1 file changed, 100 insertions(+), 32 deletions(-)

diff --git 
a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/util/ProfilingApplication.java
 
b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/util/ProfilingApplication.java
index e505fbad70..1df5896d5f 100644
--- 
a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/util/ProfilingApplication.java
+++ 
b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/util/ProfilingApplication.java
@@ -30,7 +30,9 @@ import java.io.BufferedWriter;
 import java.io.File;
 import java.io.FileWriter;
 import java.io.PrintWriter;
+import java.util.Iterator;
 import java.util.Map;
+import java.util.NoSuchElementException;
 import java.util.Random;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
@@ -48,7 +50,7 @@ import java.util.stream.IntStream;
  */
 public class ProfilingApplication {
 
-private static final Random random = new Random();
+private static final Random random = new Random(0);
 private static final String[] scripts = new String[]{
 "g.V()",
 "g.V(1).out('knows')",
@@ -87,7 +89,7 @@ public class ProfilingApplication {
 this.exercise = exercise;
 }
 
-public long execute() throws Exception {
+public long executeThroughput() throws Exception {
 final AtomicInteger tooSlow = new AtomicInteger(0);
 
 final Client client = cluster.connect();
@@ -130,16 +132,53 @@ public class ProfilingApplication {
 }
 }
 
+public double executeLatency() throws Exception {
+final Client client = cluster.connect();
+final String executionId = "[" + executionName + "]";
+try {
+client.init();
+
+long total = 0;
+
+final long start = System.nanoTime();
+int size = 0;
+final Iterator itr = client.submitAsync(script).get().iterator();
+try {
+while (true) {
+itr.next();
+size++;
+}
+} catch (NoSuchElementException nsee) {
+; // Expected as hasNext() not called to increase performance.
+}
+final long end = System.nanoTime();
+total += (end - start);
+
+
+final double totalSeconds = total / 10d;
+System.out.println(String.format(StringUtils.rightPad(executionId, 
10) + "time: %s, result count: %s", 
StringUtils.rightPad(String.valueOf(totalSeconds), 7), 
StringUtils.rightPad(String.valueOf(size), 10)));
+return totalSeconds;
+} catch (Exception ex) {
+ex.printStackTrace();
+throw new RuntimeException(ex);
+} finally {
+client.close();
+}
+}
+
 private String chooseScript() {
 return scripts[random.nextInt(scripts.length - 1)];
 }
 
+public enum TestType { UNKNOWN, LATENCY, THROUGHPUT };
+
 public static void main(final String[] args) {
 final Map options = ElementHelper.asMap(args);
 final boolean noExit = 
Boolean.parseBoolean(options.getOrDefault("noExit", "false").toString());
 final int parallelism = 
Integer.parseInt(options.getOrDefault("parallelism", "16").toString());
 final BasicThreadFactory threadFactory = new 
BasicThreadFactory.Builder().namingPattern("profiler-%d").build();
 final ExecutorService executor = 
Executors.newFixedThreadPool(parallelism, threadFactory);
+final TestType testType = 
TestType.values()[(Integer.parseInt(options.getOrDefault("testType", 
"2").toString()) % TestType.values().length)];
 
 final String host = options.getOrDefault("host", 
"localhost").toString();
 final int minExpectedRps = 
Integer.parseInt(options.getOrDefault("minExpectedRps", "1000").toString());
@@ -151,7 +190,7 @@ public class ProfilingApplication {
 final int minConnectionPoolSize = 
Integer.parseInt(options.getOrDefault("minConnectionPoolSize", 
"256").toString());
 final int maxConnectionPoolSize = 
Integer.parseInt(options.getOrDefault("maxConnectionPoolSize", 
"256").toString());
 final int maxWaitForConnection = 
Integer.parseInt(options.getOrDefault("maxWaitForConnection", 
"3000").toString());
-final int workerPoolSize = 
Integer.parseInt(options.getOrDefault("workerPoolSize", "2").toString());
+final int workerPoolSize = 
Integer.parseInt(options.getOrDefault("worker

Re: [PR] [TINKERPOP-3080] AggregateGlobalStep accepts all pre-defined Operators [tinkerpop]

2024-06-17 Thread via GitHub


rdtr commented on code in PR #2616:
URL: https://github.com/apache/tinkerpop/pull/2616#discussion_r1643211595


##
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateGlobalStep.java:
##
@@ -122,8 +121,16 @@ protected Traverser.Admin processNextStart() {
 
 @Override
 public void processAllStarts() {
+final TraversalSideEffects sideEffects = 
this.getTraversal().getSideEffects();
+
+// Pre-defined Operator such as addAll and assign will reduce over the 
whole input set, rather than
+// applying a single input one by one.

Review Comment:
   Changed the comment, please take a look



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] [TINKERPOP-3080] AggregateGlobalStep accepts all pre-defined Operators [tinkerpop]

2024-06-17 Thread via GitHub


rdtr commented on code in PR #2616:
URL: https://github.com/apache/tinkerpop/pull/2616#discussion_r1643189640


##
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ComputerVerificationStrategy.java:
##
@@ -80,6 +78,13 @@ public void apply(final Traversal.Admin traversal) {
 
 if (UNSUPPORTED_STEPS.stream().filter(c -> 
c.isAssignableFrom(step.getClass())).findFirst().isPresent())
 throw new VerificationException("The following step is 
currently not supported on GraphComputer: " + step, traversal);
+
+if (step instanceof SideEffectCapable) {
+final BinaryOperator sideEffectOperator = 
traversal.getSideEffects().getReducer(((SideEffectCapable) 
step).getSideEffectKey());
+if (sideEffectOperator instanceof Operator && (!((Operator) 
sideEffectOperator).isCommutative())) {
+throw new VerificationException("The following step has an 
SideEffect operator " + sideEffectOperator + " which is currently not supported 
on GraphComputer: " + step, traversal);
+}
+}

Review Comment:
   Without this, in GraphComputer test I see that the unit tests I added 
failed. It seems GraphComputer works like map-reduce so when we have input like 
`1,2,3,4,5,6` for example, they are split into small chunk and operator is 
applied. 
   
   So for example, let's say we have 3 hosts and data are split like `1, 6`, 
`2, 4`, and `3, 5`. With `ADD` it is fine because on each host the result would 
be `7`, `6`, and `8`. They are further summed up to 7 + 6 + 8 = 21 so the 
result is consistent.
   However, for `MINUS`, a result in each host would be `-5`, `-2`, and `-2` 
then -5 - (-2) - (-2) = -1. This is not what we want because what we expect to 
happen is 1 - 2 - 3 - 4 - 5 - 6. 
   
   I believe that we can still make it to work in distributed env with some 
tweak, but Stephen agreed to disable it for now.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] [TINKERPOP-3080] AggregateGlobalStep accepts all pre-defined Operators [tinkerpop]

2024-06-17 Thread via GitHub


rdtr commented on code in PR #2616:
URL: https://github.com/apache/tinkerpop/pull/2616#discussion_r1643180225


##
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateGlobalStep.java:
##
@@ -122,8 +121,16 @@ protected Traverser.Admin processNextStart() {
 
 @Override
 public void processAllStarts() {
+final TraversalSideEffects sideEffects = 
this.getTraversal().getSideEffects();
+
+// Pre-defined Operator such as addAll and assign will reduce over the 
whole input set, rather than
+// applying a single input one by one.
+final boolean isOperatorForBulkSet = 
sideEffects.getReducer(sideEffectKey) == Operator.addAll ||

Review Comment:
   thanks, renamed it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] TINKERPOP-3081 Fix traversal argument propagation under authentication [tinkerpop]

2024-06-17 Thread via GitHub


kenhuuu commented on PR #2622:
URL: https://github.com/apache/tinkerpop/pull/2622#issuecomment-2173915677

   VOTE +1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



(tinkerpop) branch python-http updated (d232c6ad26 -> 56de274c06)

2024-06-17 Thread xiazcy
This is an automated email from the ASF dual-hosted git repository.

xiazcy pushed a change to branch python-http
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git


from d232c6ad26 Added marker class, updated tests to use http, disabled ws 
tests for future removal
 add 56de274c06 nit fixes

No new revisions were added by this update.

Summary of changes:
 gremlin-python/src/main/python/tests/conftest.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



[PR] Python driver basic connectivity to HTTP server [tinkerpop]

2024-06-17 Thread via GitHub


xiazcy opened a new pull request, #2657:
URL: https://github.com/apache/tinkerpop/pull/2657

   Updated python HTTP connection to use the new 4.0 request/response message 
formats. Reformatted existing tests to use HTTP server (tests passed with local 
HTTP server), but will need to further modify docker set up for GH actions. 
There remains a couple of client tests that need investigation. All old WS 
sockets are currently disabled, and will be removed at a later point along with 
related implementations. 
   
   Next step is to enable chunked transfer, tests for new message formats will 
be added then. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] add getter method for CoinStep#probability [tinkerpop]

2024-06-17 Thread via GitHub


Cole-Greer commented on PR #2654:
URL: https://github.com/apache/tinkerpop/pull/2654#issuecomment-2173887012

   VOTE +1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



(tinkerpop) branch python-http updated: Added marker class, updated tests to use http, disabled ws tests for future removal

2024-06-17 Thread xiazcy
This is an automated email from the ASF dual-hosted git repository.

xiazcy pushed a commit to branch python-http
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git


The following commit(s) were added to refs/heads/python-http by this push:
 new d232c6ad26 Added marker class, updated tests to use http, disabled ws 
tests for future removal
d232c6ad26 is described below

commit d232c6ad26127f065a6c3c41efba744eeecdc53c
Author: Yang Xia <55853655+xia...@users.noreply.github.com>
AuthorDate: Mon Jun 17 09:42:45 2024 -0700

Added marker class, updated tests to use http, disabled ws tests for future 
removal
---
 .../gremlin_python/driver/aiohttp/transport.py |   6 +-
 .../main/python/gremlin_python/driver/client.py|   7 +-
 .../python/gremlin_python/driver/connection.py |  20 +-
 .../main/python/gremlin_python/driver/protocol.py  |   1 +
 .../python/gremlin_python/driver/serializer.py |  43 +--
 .../gremlin_python/structure/io/graphbinaryV1.py   |   1 +
 .../gremlin_python/structure/io/graphbinaryV4.py   |  34 +--
 .../gremlin_python/structure/io/graphsonV2d0.py|   1 +
 .../gremlin_python/structure/io/graphsonV3d0.py|   1 +
 .../python/gremlin_python/structure/io/util.py |  38 +++
 gremlin-python/src/main/python/tests/conftest.py   | 125 ++--
 .../src/main/python/tests/driver/test_client.py| 322 ++---
 .../tests/driver/test_driver_remote_connection.py  |   4 +
 .../driver/test_driver_remote_connection_http.py   |  36 +--
 .../test_driver_remote_connection_threaded.py  |  18 +-
 .../main/python/tests/driver/test_serializer.py|  24 --
 .../driver/test_web_socket_client_behavior.py  |   4 +
 .../tests/structure/io/test_functionalityio.py | 115 
 .../tests/structure/io/test_graphbinaryV1.py   |   7 +-
 ...test_graphbinaryV1.py => test_graphbinaryV4.py} |  14 +-
 .../python/tests/structure/io/test_graphsonV2d0.py |   1 +
 .../python/tests/structure/io/test_graphsonV3d0.py |   1 +
 22 files changed, 448 insertions(+), 375 deletions(-)

diff --git 
a/gremlin-python/src/main/python/gremlin_python/driver/aiohttp/transport.py 
b/gremlin-python/src/main/python/gremlin_python/driver/aiohttp/transport.py
index c43ded6f58..661ef1a759 100644
--- a/gremlin-python/src/main/python/gremlin_python/driver/aiohttp/transport.py
+++ b/gremlin-python/src/main/python/gremlin_python/driver/aiohttp/transport.py
@@ -26,6 +26,7 @@ from gremlin_python.driver.transport import 
AbstractBaseTransport
 __author__ = 'Lyndon Bauto (lynd...@bitquilltech.com)'
 
 
+# TODO: remove WS transport & refactor
 class AiohttpTransport(AbstractBaseTransport):
 nest_asyncio_applied = False
 
@@ -195,8 +196,8 @@ class AiohttpHTTPTransport(AbstractBaseTransport):
 async def async_write():
 basic_auth = None
 # basic password authentication for https connections
-# if message['auth']:
-# basic_auth = aiohttp.BasicAuth(message['auth']['username'], 
message['auth']['password'])
+if message['auth']:
+basic_auth = aiohttp.BasicAuth(message['auth']['username'], 
message['auth']['password'])
 async with async_timeout.timeout(self._write_timeout):
 self._http_req_resp = await 
self._client_session.post(url="/gremlin",
   
auth=basic_auth,
@@ -210,6 +211,7 @@ class AiohttpHTTPTransport(AbstractBaseTransport):
 def read(self):
 # Inner function to perform async read.
 async def async_read():
+# TODO: set-up chunked reading
 buffer = b""
 # async for data, end_of_http_chunk in 
self._http_req_resp.content.iter_chunks():
 # buffer += data
diff --git a/gremlin-python/src/main/python/gremlin_python/driver/client.py 
b/gremlin-python/src/main/python/gremlin_python/driver/client.py
index 624f55b973..fc1ef95bcd 100644
--- a/gremlin-python/src/main/python/gremlin_python/driver/client.py
+++ b/gremlin-python/src/main/python/gremlin_python/driver/client.py
@@ -38,6 +38,7 @@ except ImportError:
 __author__ = 'David M. Brown (davebs...@gmail.com), Lyndon Bauto 
(lynd...@bitquilltech.com)'
 
 
+# TODO: remove session, update connection pooling, etc.
 class Client:
 
 def __init__(self, url, traversal_source, protocol_factory=None,
@@ -58,7 +59,7 @@ class Client:
 if not self._use_http and "max_content_length" not in transport_kwargs:
 transport_kwargs["max_content_length"] = 10 * 1024 * 1024
 if message_serializer is None:
-message_serializer = serializer.GraphBinarySerializersV1()
+message_serializer = serializer.GraphBinarySerializersV4()
 
 self._message_serializer = message_serializer
 self._username = username
@@ -180,7 +181,6 @@ class Client:
 raise Exception("Client is closed")
 
 log.debug("message '%s'", str(message))
-# 

(tinkerpop) branch dependabot/npm_and_yarn/gremlin-javascript/src/main/javascript/gremlin-javascript/3.6-dev/eslint-9.4.0 deleted (was c327607249)

2024-06-17 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch 
dependabot/npm_and_yarn/gremlin-javascript/src/main/javascript/gremlin-javascript/3.6-dev/eslint-9.4.0
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git


 was c327607249 Bump eslint

The revisions that were on this branch are still contained in
other references; therefore, this change does not discard any commits
from the repository.



(tinkerpop) branch dependabot/npm_and_yarn/gremlin-javascript/src/main/javascript/gremlin-javascript/3.6-dev/eslint-9.5.0 created (now 52ce952a1f)

2024-06-17 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch 
dependabot/npm_and_yarn/gremlin-javascript/src/main/javascript/gremlin-javascript/3.6-dev/eslint-9.5.0
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git


  at 52ce952a1f Bump eslint

No new revisions were added by this update.



Re: [PR] Bump eslint from 8.57.0 to 9.4.0 in /gremlin-javascript/src/main/javascript/gremlin-javascript [tinkerpop]

2024-06-17 Thread via GitHub


dependabot[bot] commented on PR #2630:
URL: https://github.com/apache/tinkerpop/pull/2630#issuecomment-2173569205

   Superseded by #2656.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Bump eslint from 8.57.0 to 9.4.0 in /gremlin-javascript/src/main/javascript/gremlin-javascript [tinkerpop]

2024-06-17 Thread via GitHub


dependabot[bot] closed pull request #2630: Bump eslint from 8.57.0 to 9.4.0 in 
/gremlin-javascript/src/main/javascript/gremlin-javascript
URL: https://github.com/apache/tinkerpop/pull/2630


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[PR] Bump eslint from 8.57.0 to 9.5.0 in /gremlin-javascript/src/main/javascript/gremlin-javascript [tinkerpop]

2024-06-17 Thread via GitHub


dependabot[bot] opened a new pull request, #2656:
URL: https://github.com/apache/tinkerpop/pull/2656

   Bumps [eslint](https://github.com/eslint/eslint) from 8.57.0 to 9.5.0.
   
   Release notes
   Sourced from https://github.com/eslint/eslint/releases";>eslint's releases.
   
   v9.5.0
   Features
   
   https://github.com/eslint/eslint/commit/b2d256c7356838f908c4a5762d6dc64b41bbce5d";>b2d256c
 feat: no-sparse-arrays report on "comma" instead of the 
whole array (https://redirect.github.com/eslint/eslint/issues/18579";>#18579) 
(fisker Cheung)
   
   Bug Fixes
   
   https://github.com/eslint/eslint/commit/6880286e17375b08323512f38ea59fed440a4fb5";>6880286
 fix: treat * as a universal pattern (https://redirect.github.com/eslint/eslint/issues/18586";>#18586) 
(Milos Djermanovic)
   https://github.com/eslint/eslint/commit/7fbe211427432aba5fa972252b9b6b5cf9866624";>7fbe211
 fix: message template for all files ignored (https://redirect.github.com/eslint/eslint/issues/18564";>#18564) 
(Milos Djermanovic)
   https://github.com/eslint/eslint/commit/469cb363f87564bafb8e628e738e01b53f4d6911";>469cb36
 fix: Don't lint the same file multiple times (https://redirect.github.com/eslint/eslint/issues/18552";>#18552) 
(Milos Djermanovic)
   https://github.com/eslint/eslint/commit/5cff638c03183204d09eb0a7a8bd2e032630db17";>5cff638
 fix: improve message for ignored files without a matching config (https://redirect.github.com/eslint/eslint/issues/18404";>#18404) 
(Francesco Trotta)
   
   Documentation
   
   https://github.com/eslint/eslint/commit/455f7fd1662069e9e0f4dc912ecda72962679fbe";>455f7fd
 docs: add section about including .gitignore files (https://redirect.github.com/eslint/eslint/issues/18590";>#18590) 
(Milos Djermanovic)
   https://github.com/eslint/eslint/commit/721eafeae45b33b95addf385c23eca1e2f8017d0";>721eafe
 docs: update info about universal files patterns (https://redirect.github.com/eslint/eslint/issues/18587";>#18587) 
(Francesco Trotta)
   https://github.com/eslint/eslint/commit/8127127386180a2882bb1b75a8fbc7ffda78dce1";>8127127
 docs: Update README (GitHub Actions Bot)
   https://github.com/eslint/eslint/commit/55c2a6621cc403f2fc11eb4ad762eadc70a54874";>55c2a66
 docs: Update README (GitHub Actions Bot)
   https://github.com/eslint/eslint/commit/eb76282e0a2db8aa10a3d5659f5f9237d9729121";>eb76282
 docs: Update README (GitHub Actions Bot)
   https://github.com/eslint/eslint/commit/ff6e96ec30862a4eb77a201551ec8c618335bfc2";>ff6e96e
 docs: baseConfig and overrideConfig can be arrays 
(https://redirect.github.com/eslint/eslint/issues/18571";>#18571) 
(Milos Djermanovic)
   https://github.com/eslint/eslint/commit/d2d83e045ad03f024d1679275708054d789ebe20";>d2d83e0
 docs: Add mention of eslint-transforms to v9 migration guide (https://redirect.github.com/eslint/eslint/issues/18566";>#18566) 
(Nicholas C. Zakas)
   https://github.com/eslint/eslint/commit/9ce6832578d5798b591f490a8609c87235e881c7";>9ce6832
 docs: add callout box for unintuitive behavior (https://redirect.github.com/eslint/eslint/issues/18567";>#18567) (Ben 
McCann)
   https://github.com/eslint/eslint/commit/b8db99c575c75edc9b42e6333e1b0aa7d26d9a01";>b8db99c
 docs: Add VS Code info to config migration guide (https://redirect.github.com/eslint/eslint/issues/18555";>#18555) 
(Nicholas C. Zakas)
   https://github.com/eslint/eslint/commit/518a35c8fa9161522cbe9066d48e6c6fcd8aadf3";>518a35c
 docs: Mention config migrator (https://redirect.github.com/eslint/eslint/issues/18561";>#18561) 
(Nicholas C. Zakas)
   https://github.com/eslint/eslint/commit/eb440fcf16bd2f62d58b7aa9bbaf546cd94e9918";>eb440fc
 docs: specifying files with arbitrary or no extension (https://redirect.github.com/eslint/eslint/issues/18539";>#18539) 
(Francesco Trotta)
   https://github.com/eslint/eslint/commit/38c159e7dda812ce6dfdbf8c5b78db7cdd676c62";>38c159e
 docs: Provide example of reading package.json for plugins meta (https://redirect.github.com/eslint/eslint/issues/18530";>#18530) 
(Nicholas C. Zakas)
   https://github.com/eslint/eslint/commit/d16a6599cad35726f62eb230bb95af463611c6c6";>d16a659
 docs: add link to migration guide for --ext CLI option (https://redirect.github.com/eslint/eslint/issues/18537";>#18537) 
(Milos Djermanovic)
   https://github.com/eslint/eslint/commit/73408de08dbe1873bf6b5564533c0d81134cfeee";>73408de
 docs: add link to configuration file docs before examples (https://redirect.github.com/eslint/eslint/issues/18535";>#18535) 
(Milos Djermanovic)
   
   Chores
   
   https://github.com/eslint/eslint/commit/f588160c2f9996c9c62b787f1fe678f71740ec43";>f588160
 chore: upgrade @​eslint/jshttps://github.com/9";>@​9.5.0 (https://redirect.github.com/eslint/eslint/issues/18591";>#18591) 
(Milos Djermanovic)
   https://github.com/eslint/eslint/commit/58908415c3e9e7924d39a2ff96573f7677ddb806";>5890841
 chore: package.json update for @​eslint/js release (Jenkins)
   https://github.com/eslint/eslint/commit/e9f4ccd8a182801e08d96d4246df10246ea82a58";>e9f4ccd
 chor

(tinkerpop) branch dependabot/npm_and_yarn/gremlin-javascript/src/main/javascript/gremlin-javascript/3.6-dev/ws-8.17.1 created (now e4515ee2a9)

2024-06-17 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch 
dependabot/npm_and_yarn/gremlin-javascript/src/main/javascript/gremlin-javascript/3.6-dev/ws-8.17.1
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git


  at e4515ee2a9 Bump ws in 
/gremlin-javascript/src/main/javascript/gremlin-javascript

No new revisions were added by this update.



[PR] Bump ws from 8.17.0 to 8.17.1 in /gremlin-javascript/src/main/javascript/gremlin-javascript [tinkerpop]

2024-06-17 Thread via GitHub


dependabot[bot] opened a new pull request, #2655:
URL: https://github.com/apache/tinkerpop/pull/2655

   Bumps [ws](https://github.com/websockets/ws) from 8.17.0 to 8.17.1.
   
   Release notes
   Sourced from https://github.com/websockets/ws/releases";>ws's 
releases.
   
   8.17.1
   Bug fixes
   
   Fixed a DoS vulnerability (https://redirect.github.com/websockets/ws/issues/2231";>#2231).
   
   A request with a number of headers exceeding 
the[server.maxHeadersCount][]
   threshold could be used to crash a ws server.
   const http = require('http');
   const WebSocket = require('ws');
   const server = http.createServer();
   const wss = new WebSocket.Server({ server });
   server.listen(function () {
   const chars = 
"!#$%&'*+-.0123456789abcdefghijklmnopqrstuvwxyz^_`|~".split('');
   const headers = {};
   let count = 0;
   for (let i = 0; i < chars.length; i++) {
   if (count === 2000) break;
   for (let j = 0; j < chars.length; j++) {
 const key = chars[i] + chars[j];
 headers[key] = 'x';
   
 if (++count === 2000) break;
   }
   
   }
   headers.Connection = 'Upgrade';
   headers.Upgrade = 'websocket';
   headers['Sec-WebSocket-Key'] = 'dGhlIHNhbXBsZSBub25jZQ==';
   headers['Sec-WebSocket-Version'] = '13';
   const request = http.request({
   headers: headers,
   host: '127.0.0.1',
   port: server.address().port
   });
   request.end();
   });
   
   The vulnerability was reported by https://github.com/rrlapointe";>Ryan LaPointe in https://redirect.github.com/websockets/ws/issues/2230";>websockets/ws#2230.
   In vulnerable versions of ws, the issue can be mitigated in the following 
ways:
   
   
   ... (truncated)
   
   
   Commits
   
   https://github.com/websockets/ws/commit/3c56601092872f7d7566989f0e379271afd0e4a1";>3c56601
 [dist] 8.17.1
   https://github.com/websockets/ws/commit/e55e5106f10fcbaac37cfa89759e4cc0d073a52c";>e55e510
 [security] Fix crash when the Upgrade header cannot be read (https://redirect.github.com/websockets/ws/issues/2231";>#2231)
   https://github.com/websockets/ws/commit/6a00029edd924499f892aed8003cef1fa724cfe5";>6a00029
 [test] Increase code coverage
   https://github.com/websockets/ws/commit/ddfe4a804d79e7788ab136290e609f91cf68423f";>ddfe4a8
 [perf] Reduce the amount of crypto.randomFillSync() calls
   See full diff in https://github.com/websockets/ws/compare/8.17.0...8.17.1";>compare 
view
   
   
   
   
   
   [![Dependabot compatibility 
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ws&package-manager=npm_and_yarn&previous-version=8.17.0&new-version=8.17.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
   
   Dependabot will resolve any conflicts with this PR as long as you don't 
alter it yourself. You can also trigger a rebase manually by commenting 
`@dependabot rebase`.
   
   [//]: # (dependabot-automerge-start)
   [//]: # (dependabot-automerge-end)
   
   ---
   
   
   Dependabot commands and options
   
   
   You can trigger Dependabot actions by commenting on this PR:
   - `@dependabot rebase` will rebase this PR
   - `@dependabot recreate` will recreate this PR, overwriting any edits that 
have been made to it
   - `@dependabot merge` will merge this PR after your CI passes on it
   - `@dependabot squash and merge` will squash and merge this PR after your CI 
passes on it
   - `@dependabot cancel merge` will cancel a previously requested merge and 
block automerging
   - `@dependabot reopen` will reopen this PR if it is closed
   - `@dependabot close` will close this PR and stop Dependabot recreating it. 
You can achieve the same result by closing it manually
   - `@dependabot show  ignore conditions` will show all of 
the ignore conditions of the specified dependency
   - `@dependabot ignore this major version` will close this PR and stop 
Dependabot creating any more for this major version (unless you reopen the PR 
or upgrade to it yourself)
   - `@dependabot ignore this minor version` will close this PR and stop 
Dependabot creating any more for this minor version (unless you reopen the PR 
or upgrade to it yourself)
   - `@dependabot ignore this dependency` will close this PR and stop 
Dependabot creating any more for this dependency (unless you reopen the PR or 
upgrade to it yourself)
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org