You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by "Divyansh200102 (via GitHub)" <gi...@apache.org> on 2024/02/19 12:27:25 UTC

[PR] Add test case for `AbstractShenyuWasmPlugin` [shenyu]

Divyansh200102 opened a new pull request, #5444:
URL: https://github.com/apache/shenyu/pull/5444

   <!-- Describe your PR here; e.g. Fixes #issueNo -->#5427
   
   <!--
   Thank you for proposing a pull request. This template will guide you through the essential steps necessary for a pull request.
   -->
   Make sure that:
   
   - [ ] You have read the [contribution guidelines](https://shenyu.apache.org/community/contributor-guide).
   - [ ] You submit test cases (unit or integration tests) that back your changes.
   - [ ] Your local test passed `./mvnw clean install -Dmaven.javadoc.skip=true`.
   


-- 
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: notifications-unsubscribe@shenyu.apache.org

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


Re: [PR] Add test case for `AbstractShenyuWasmPlugin` [shenyu]

Posted by "Divyansh200102 (via GitHub)" <gi...@apache.org>.
Divyansh200102 commented on PR #5444:
URL: https://github.com/apache/shenyu/pull/5444#issuecomment-1952364311

   @loongs-zhang I am getting a null pointer exception here could you please take a look?
   
   ![image](https://github.com/apache/shenyu/assets/146909065/0f8ce7fc-d1cf-4b46-9497-1a6dab171df0)
   
   ```powershell
   WARNING: If a serviceability tool is not in use, please run with -Djdk.instrument.traceUsage for more information
   WARNING: Dynamic loading of agents will be disallowed by default in a future release
   Java HotSpot(TM) 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
   18:03:17.704 [main] DEBUG io.github.kawamuray.wasmtime.NativeLibraryLoader - Loading Wasmtime JNI library from C:\Users\Divyansh\AppData\Local\Temp\wasmtime_jni_0.19.0_windows_x86_648134173620995520118.dll
   18:03:17.760 [main] DEBUG io.github.kawamuray.wasmtime.Func - New trampoline 0 of type FuncType(params=[I64, I64, I32], results=[I32])
   18:03:17.763 [main] DEBUG io.github.kawamuray.wasmtime.Func - New trampoline 1 of type FuncType(params=[I64, I64, I32], results=[I32])
   18:03:18.280 [main] DEBUG reactor.util.Loggers - Using Slf4j logging framework
   rust side-> buffer base address: 1048496
   18:03:19.532 [main] DEBUG io.github.kawamuray.wasmtime.Func - Trampoline 0 invoked with params=[Val(type=I64, value=0), Val(type=I64, value=1048496), Val(type=I32, value=32)], results=[null]
   18:03:19.533 [main] INFO org.apache.shenyu.plugin.wasm.base.AbstractShenyuWasmPlugin - java side->hello from java 0
   rust side-> recv:hello from java 0
   18:03:19.539 [main] DEBUG io.github.kawamuray.wasmtime.Func - Trampoline 1 invoked with params=[Val(type=I64, value=0), Val(type=I64, value=1048780), Val(type=I32, value=11)], results=[null]
   18:03:19.539 [main] INFO org.apache.shenyu.plugin.wasm.base.AbstractShenyuWasmPlugin - java side->rust result
   18:03:19.544 [main] ERROR org.apache.shenyu.plugin.wasm.base.AbstractShenyuWasmPlugin - doExecute function not found in org.apache.shenyu.plugin.wasm.base.AbstractShenyuWasmPluginTest$RustShenyuWasmPlugin.wasm
   
   java.lang.NullPointerException: Cannot invoke "org.apache.shenyu.plugin.api.result.ShenyuResult.error(org.springframework.web.server.ServerWebExchange, int, String, Object)" because the return value of "org.apache.shenyu.plugin.api.result.ShenyuResultWrap.shenyuResult()" is null
   
   ``` 
   


-- 
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: notifications-unsubscribe@shenyu.apache.org

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


Re: [PR] Add test case for `AbstractShenyuWasmPlugin` [shenyu]

Posted by "Divyansh200102 (via GitHub)" <gi...@apache.org>.
Divyansh200102 commented on PR #5444:
URL: https://github.com/apache/shenyu/pull/5444#issuecomment-1954992189

   > It seems that you did not regenerate the wasm file, please refer to https://github.com/apache/shenyu/blob/master/shenyu-plugin/shenyu-plugin-wasm-api/src/test/README.md
   
   I actually did generate the wasm file and according to the documentation I put it in the resources folder
   
   ![image](https://github.com/apache/shenyu/assets/146909065/257d8cb5-a3d9-4224-a83b-ee35e13d0e0c)
   
   ![image](https://github.com/apache/shenyu/assets/146909065/ec5d6993-d72a-450e-90d1-42fc315c5936)


-- 
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: notifications-unsubscribe@shenyu.apache.org

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


Re: [PR] Add test case for `AbstractShenyuWasmPlugin` [shenyu]

Posted by "loongs-zhang (via GitHub)" <gi...@apache.org>.
loongs-zhang commented on PR #5444:
URL: https://github.com/apache/shenyu/pull/5444#issuecomment-1953664129

   It seems that you did not regenerate the wasm file, please refer to https://github.com/apache/shenyu/blob/master/shenyu-plugin/shenyu-plugin-wasm-api/src/test/README.md


-- 
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: notifications-unsubscribe@shenyu.apache.org

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


Re: [PR] Add test case for `AbstractShenyuWasmPlugin` [shenyu]

Posted by "Divyansh200102 (via GitHub)" <gi...@apache.org>.
Divyansh200102 closed pull request #5444: Add test case for `AbstractShenyuWasmPlugin`
URL: https://github.com/apache/shenyu/pull/5444


-- 
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: notifications-unsubscribe@shenyu.apache.org

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


Re: [PR] Add test case for `AbstractShenyuWasmPlugin` [shenyu]

Posted by "Divyansh200102 (via GitHub)" <gi...@apache.org>.
Divyansh200102 commented on code in PR #5444:
URL: https://github.com/apache/shenyu/pull/5444#discussion_r1496441451


##########
shenyu-plugin/shenyu-plugin-api/src/main/java/org/apache/shenyu/plugin/api/ShenyuPluginChain.java:
##########
@@ -32,4 +34,5 @@ public interface ShenyuPluginChain {
      * @return {@code Mono<Void>} to indicate when request handling is complete
      */
     Mono<Void> execute(ServerWebExchange exchange);
+    Mono<Void> doExecute(ServerWebExchange exchange, SelectorData selector, RuleData rule);

Review Comment:
   Then what do you recommend I should do?



-- 
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: notifications-unsubscribe@shenyu.apache.org

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


Re: [PR] Add test case for `AbstractShenyuWasmPlugin` [shenyu]

Posted by "loongs-zhang (via GitHub)" <gi...@apache.org>.
loongs-zhang commented on code in PR #5444:
URL: https://github.com/apache/shenyu/pull/5444#discussion_r1495380071


##########
shenyu-plugin/shenyu-plugin-wasm-base/pom.xml:
##########
@@ -46,5 +46,10 @@
             <artifactId>jackson-module-kotlin</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.shenyu</groupId>
+            <artifactId>shenyu-plugin-wasm-base</artifactId>
+            <version>${project.version}</version>
+        </dependency>

Review Comment:
   rollback this



-- 
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: notifications-unsubscribe@shenyu.apache.org

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


Re: [PR] Add test case for `AbstractShenyuWasmPlugin` [shenyu]

Posted by "loongs-zhang (via GitHub)" <gi...@apache.org>.
loongs-zhang commented on PR #5444:
URL: https://github.com/apache/shenyu/pull/5444#issuecomment-1962328824

   see https://github.com/apache/shenyu/pull/5450


-- 
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: notifications-unsubscribe@shenyu.apache.org

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


Re: [PR] Add test case for `AbstractShenyuWasmPlugin` [shenyu]

Posted by "loongs-zhang (via GitHub)" <gi...@apache.org>.
loongs-zhang commented on code in PR #5444:
URL: https://github.com/apache/shenyu/pull/5444#discussion_r1495379637


##########
shenyu-plugin/shenyu-plugin-api/src/main/java/org/apache/shenyu/plugin/api/ShenyuPluginChain.java:
##########
@@ -32,4 +34,5 @@ public interface ShenyuPluginChain {
      * @return {@code Mono<Void>} to indicate when request handling is complete
      */
     Mono<Void> execute(ServerWebExchange exchange);
+    Mono<Void> doExecute(ServerWebExchange exchange, SelectorData selector, RuleData rule);

Review Comment:
   This class should not be modified.



-- 
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: notifications-unsubscribe@shenyu.apache.org

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


Re: [PR] Add test case for `AbstractShenyuWasmPlugin` [shenyu]

Posted by "Divyansh200102 (via GitHub)" <gi...@apache.org>.
Divyansh200102 closed pull request #5444: Add test case for `AbstractShenyuWasmPlugin`
URL: https://github.com/apache/shenyu/pull/5444


-- 
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: notifications-unsubscribe@shenyu.apache.org

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


Re: [PR] Add test case for `AbstractShenyuWasmPlugin` [shenyu]

Posted by "Divyansh200102 (via GitHub)" <gi...@apache.org>.
Divyansh200102 commented on code in PR #5444:
URL: https://github.com/apache/shenyu/pull/5444#discussion_r1496441451


##########
shenyu-plugin/shenyu-plugin-api/src/main/java/org/apache/shenyu/plugin/api/ShenyuPluginChain.java:
##########
@@ -32,4 +34,5 @@ public interface ShenyuPluginChain {
      * @return {@code Mono<Void>} to indicate when request handling is complete
      */
     Mono<Void> execute(ServerWebExchange exchange);
+    Mono<Void> doExecute(ServerWebExchange exchange, SelectorData selector, RuleData rule);

Review Comment:
   Then what do you recommend I should do?



-- 
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: notifications-unsubscribe@shenyu.apache.org

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