Giter Site home page Giter Site logo

Comments (4)

civic9 avatar civic9 commented on May 24, 2024 2

The issue still occurs with sbt 1.9.9 (Play 2.9).

I understand this is a low priority issue.

from playframework.

mkurz avatar mkurz commented on May 24, 2024 1

So this is most likely caused by

Which version of sbt are you using in your project/build.properties? Please try with sbt version 1.7.2 when using Play 2.8.12+ or sbt 1.9.7 when using Play 2.9 or 3.0 and let me know if that fixes the problem.

However, given that this is working on Linux and "only" broken on Windows and the fact that this very likely is a problem only in dev mode, but should work fine in prod mode, I will not spend time to fix this problem. Also probably sbt magic is involved here as well...

If you want to fix this, I am happy to review a pull request. But I am not going to look further into this issue at this point.

from playframework.

Mandog1120 avatar Mandog1120 commented on May 24, 2024

เล่นเวอร์ชัน

3.0.1 (แต่อาจเป็นทุกเวอร์ชันตั้งแต่ 2.8.12)

เอพีไอ

ชวา

ระบบปฏิบัติการ

Windows Server 2016 Std เวอร์ชัน Windows 10 Linux ไม่ได้รับผลกระทบจากปัญหานี้

เจดีเค

openjdk version "21.0.1" 2023-10-17 LTS
OpenJDK Runtime Environment Temurin-21.0.1+12 (build 21.0.1+12-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.1+12 (build 21.0.1+12-LTS, mixed mode, sharing)

แต่ทดสอบด้วยผลลัพธ์เดียวกันกับการแจกแจงอื่น ๆ (oracle) และเวอร์ชัน (11, 17)

การพึ่งพาห้องสมุด

"org.jblas" % "jblas" % "1.2.5", // https://github.com/jblas-project/jblas

พฤติกรรมที่คาดหวัง

  1. สร้างโปรเจ็กต์ play-java-seed
  2. รวม
    "org.jblas" % "jblas" % "1.2.5"
    ในไลบรารีการพึ่งพาใน build.sbt
  3. สร้างคอนโทรลเลอร์ง่ายๆดังนี้:
package controllers;

import play.mvc.*;
import org.jblas.DoubleMatrix;
import org.jblas.MatrixFunctions;

public class JblasTest extends Controller {

	public Result index() {

		System.out.println("STEP 1");
		DoubleMatrix Ms = new DoubleMatrix(5,5);

		System.out.println("STEP 2");
		Ms = Ms.mul(2);

		System.out.println("STEP 3");
		DoubleMatrix expMs = MatrixFunctions.expm(Ms); // JNI call in jblas

		System.out.println("STEP 4");
		return ok("OK");
	}

}

รหัสนี้ควรดำเนินการโดยไม่มีปัญหาใด ๆ และพิมพ์ขั้นตอนที่ 1-4 ไปยังเอาต์พุตมาตรฐาน

พฤติกรรมที่แท้จริง

การเล่น (หรือเฉพาะเจาะจงกว่านั้นคือแค่เธรดปัจจุบันที่จัดการคำขอ) ค้างเมื่อ เรียกใช้ MatrixFunctions.expm ดังนั้นจึงพิมพ์เฉพาะขั้นตอนที่ 1, 2 และ 3 บนเอาต์พุต stardard การเรียกใช้ฟังก์ชัน jblas มาตรฐานเช่นเดียวกับในขั้นตอนที่ 1 และขั้นตอนที่ 2 ทำงานได้ดี แต่การเล่นค้างในขั้นตอนที่ 3 ซึ่ง afaik ใช้ JNI ใน jblas

แต่หากฉันป้อนอักขระสองตัวโดยใช้แป้นพิมพ์บน Play Console การดำเนินการจะเสร็จสิ้นและขั้นตอนที่ 4 จะถูกพิมพ์

กรณีทดสอบที่สามารถทำซ้ำได้

สิ่งนี้สามารถทดสอบได้แม้จะมีโค้ดเพียงบรรทัดเดียว:

System.out.println("STEP1");
MatrixFunctions.expm(new DoubleMatrix(5,5));
System.out.println("STEP2");

ความคิดเห็นอื่น ๆ

ฉันเพิ่งอัปเกรดโปรเจ็กต์ของฉันจากเฟรมเวิร์กการเล่น 2.8.x เก่าเป็น 3.0.1 ล่าสุด ในรีลีส 2.8.x แรก สิ่งนี้ใช้งานได้โดยไม่มีปัญหาใดๆ ฉันได้ตรวจสอบรหัสนี้ในเวอร์ชันเก่าหลายเวอร์ชันแล้ว รหัสนี้ใช้งานได้โดยไม่มีปัญหาใดๆ จนถึงเวอร์ชัน 2.8.11 ในเวอร์ชัน 2.8.12 (และอาจเป็นรุ่นใหม่ทั้งหมด) มันค้างตามที่อธิบายไว้ข้างต้น ดังที่ฉันเห็นในประวัติการคอมมิต มีการเปลี่ยนแปลงบางอย่างใน consolereader ระหว่างเวอร์ชันเหล่านั้น ซึ่ง อาจเกี่ยวข้องกับปัญหานี้

รหัสนี้ยังทำงานได้ดีนอกการเล่น ฉันไม่เห็น การโต้ตอบกับอินพุตหรือคอนโซลมาตรฐาน

from playframework.

civic9 avatar civic9 commented on May 24, 2024

Yes, it works fine in prod mode, only dev mode is affected.

The issue still occurs with sbt 1.7.2 (Play 2.8.12) and sbt 1.9.7 (Play 2.9).

We can run Play using:

 echo | set /p dummyName=abc | sbt run

This passes the string "abc" (no new line, this is important) to Play input,
which satisfies the need for Play/sbt to consume some input, and jblas is working fine.

But after this Java process causes high CPU usage permanently :(

I can't fix it this myself, sbt and scala are black magic to me.

from playframework.

mkurz avatar mkurz commented on May 24, 2024

For the sake of completeness, can you also try sbt 1.9.9? (I don't expect it to work actually, but they did upgrade Jline in the release, so who knows)
Like said I will not prioritize this issue currently since it's "only" broken when using Windows, in dev mode, when pulling in the jblas library. Maybe someone steps up to invest time, also in case that's you I am happy to review a pull request.
Thanks for reporting anyway!

from playframework.

Mandog1120 avatar Mandog1120 commented on May 24, 2024

#12355

from playframework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.