[Bug]: Local filesystem ancestor copies delete the source and unrelated files
I maintainer di solito rispondono entro 2 giorni
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
What happened?
FileSystems.copy() can delete the source and unrelated files when an existing destination directory is an ancestor of the source. The source and destination are distinct objects, so the existing same-file check does not prevent the deletion.
Reproduced on current master a9b9e8d3cd13e1b5109175968bf00d137f497cf8, Windows / Python 3.11.7, using current Python sources and real local filesystem operations.
Reproduction
from pathlib import Path
from tempfile import TemporaryDirectory
from apache_beam.io.filesystem import BeamIOError
from apache_beam.io.filesystems import FileSystems
with TemporaryDirectory() as temporary:
tree = Path(temporary) / "tree"
source = tree / "source"
source.mkdir(parents=True)
(source / "data").write_text("source data")
(tree / "unrelated").write_text("keep this")
try:
FileSystems.copy([str(source)], [str(tree)])
except BeamIOError as error:
print(error)
print((source / "data").exists()) # False
print((tree / "unrelated").exists()) # False
A source file copied to its containing directory loses data in the same way. LocalFileSystem.copy() removes the existing destination before attempting to read the source.
Expected behavior
Reject the overlapping pair through the existing BeamIOError aggregation before removing any destination data. Copying a directory into one of its own output descendants should also be rejected before entering copytree. Independent valid pairs in the batch should continue as they currently do.
The check needs to account for source access through link entries/targets and Windows drive-relative paths. Looking only at the final resolved source misses a link inside the destination that points outside; looking only at original parents misses an outside link whose target or intermediate link is inside the destination. Normal disjoint copies, including a harmless source/../neighbor output, should continue to work.
This is a follow-up to #41561 / #41562, which addressed copying onto the same filesystem object. It does not require changing cloud filesystems or making local copies transactional.
- Lingua principale
- Java
- Stelle
- 8.7k
- Fork
- 4.8k
- Merge medio
- 3g 16h
- PR unite (30g)
- 445
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/beam
-
awaiting triage java new feature P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
[Bug]: [Python] BigTableEnrichmentHandler coerces None lookup keys to literal b'None' and formats blank key name on KeyErrorForse già presa @shikhabhadoria l’ha presa 6 giorni fa. Apertaio P2 python
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
apache/beam#41346 · 4 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
Release notes links wrongForse già presa @schizophrenicmaniac l’ha presa 20 giorni fa. Apertabug P3
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 67/100
apache/beam#41197 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
apache/beam#39624 · 2 reazioni ·
I maintainer di solito rispondono entro 2 giorni
-
[Bug]: PubsubIO used in batch incorrect batch cutoff sizeForse già presa @1fanwang l’ha presa 98 giorni fa. Apertabug io P3 pinned pubsub
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/beam#28011 · 4 commenti ·
I maintainer di solito rispondono entro 2 giorni
Issue simili
-
`ovsx verify` fails for a version older than the 100 newest of an extensionForse già presa @trivikr l’ha presa oggi. Apertacli
Difficoltà 2/5 1-3 ore Idoneità per principianti 81/100
eclipse-openvsx/openvsx#2482 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
Magic-team-jvav/confluence#281 ·
-
CVE-2026-139999 react-routerApertaarea/dependencies area/dependencies/js backport/26.6 backport/26.8 kind/cve severity/medium source/scan-dependencies status/triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 67/100
I maintainer di solito rispondono entro 2 giorni
-
[DEFECT] AsciiDoc builders write a stray ## before every schema member when the namespace prefixes file binds the schema's own namespaceForse già presa @Beehtrix l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
cimug-org/CIMTool#427 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
userRaised
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
eclipse-openj9/openj9#25285 ·
I maintainer di solito rispondono entro 1 giorno