EmbeddedMavenExecutor restores a constructor-time System snapshot after every run
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 88/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- java
- Lĩnh vực
- build-system
Hướng nghiên cứu
Bắt đầu với maven-executor/src/main/java/org/apache/maven/executor/embedded/EmbeddedMavenExecutor.java tại các dòng 128-129 và 159-162, sau đó lần theo execute() để hiểu khi nào trạng thái System được ghi lại và khôi phục. Hoàn thành khi các lần thực thi lặp lại trên cùng một executor tồn tại lâu dài vẫn giữ nguyên các thuộc tính hệ thống được thiết lập giữa các lần chạy; hãy thêm hoặc cập nhật độ bao phủ cho hành vi đó nếu các bài kiểm thử xung quanh có vị trí phù hợp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Affected version
1.0.0
Bug description
EmbeddedMavenExecutor copies System.getProperties() once, in its constructor (EmbeddedMavenExecutor.java:128-129), together with System.out and System.err, and restores that same snapshot in the finally block of every execute() (:159-162). Any change a caller makes to system properties between two executions on one long-lived executor is silently reverted after the next run. maven-verifier's Embedded3xLauncher snapshotted per run.
The pattern that triggers it is the natural one for a test fixture: one ExecutorHelper per JVM, reused across hundreds of integration tests, some of which set a system property to drive the next build. Found while porting maven-surefire's IT fixture (apache/maven-surefire#3484); the fixture now creates one executor per Verifier instance to avoid it.
Proposal: take the snapshot at the start of each execute() rather than in the constructor. This is distinct from the thread-safety window in #16 item 8, which is about System.setProperties(null) during a run.
The same JVM-lifetime pattern is in apache/maven itself: its/core-it-support/maven-it-helper/.../Verifier.java holds static final EmbeddedMavenExecutor and ForkedMavenExecutor instances, so the core ITs on master and on the 3.x branches (apache/maven-integration-testing#445) are exposed as well; fixing the snapshot point in the executor covers all of them.
The obvious workaround, one EmbeddedMavenExecutor per execution closed afterwards, does not work at scale: on apache/maven-surefire#3484 (run 35594937350) the IT JVM runs out of heap after roughly a hundred builds (java.lang.OutOfMemoryError: Java heap space inside the embedded Maven), because close() does not release the Maven ClassWorld the constructor built. So callers are pushed back to a JVM-lifetime executor and inherit the snapshot behaviour; moving the snapshot into execute() is the fix that avoids both.
- Ngôn ngữ chính
- Java
- Star
- 5
- Fork
- 2
- Merge trung bình
- 2 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/maven-executor
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
apache/maven-executor#58 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
apache/maven-executor#50 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
enhancement priority:major
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
apache/maven-executor#49 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 78/100
apache/maven-executor#48 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
apache/maven-executor#45 ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của apache/maven-executor
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
component/zeebe kind/bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
UniversalMediaServer/UniversalMediaServer#6356 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
refinedmods/refinedstorage2#1414 · 1 bình luận ·
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
yegor256/rultor-image#76 · 1 bình luận ·