Repository navigation
Conversation
|
Fork CI: failed. CI for the latest commit failed in your fork. Fix the failures and push again. Pull requests from contributors run their CI in the contributor's own fork. GitHub Actions is free and has no minute limit on public forks, while the CI capacity of the Apache Software Foundation is shared by every ASF project and is finite. Latest run: https://github.com/yuseok89/airflow/actions/runs/46686780383 Jobs that did not pass: How this works: CI in your fork. This comment was posted automatically by the fork CI monitor from templates drafted with an AI-assisted tool, so it may contain mistakes. An Apache Airflow maintainer, a real person, will review the pull request once its fork CI is green. Why the first pass is automated. |
There was a problem hiding this comment.
Thanks @yuseok89 for the effort already, really nice to see this involvement on such short notice.
Addressed
Nothing since the previous round: this is the first review, and the PR has no other review threads.
Open
- [1] the host part of the URL is ignored, the docs say otherwise (warning).
- [4] a dead control connection makes
lsreturn an empty list; the store cache keeps the connection for the life of the process (warning). - [2] same-connection copy raises
NotImplementedError; worth a line in the docs (nit). - [3]
fsspecimported but not declared as a dependency (nit). - CI: fork CI is green (28 jobs, merged with
main@577554cd1d); the only pending check isWIP, because the PR is a draft.
Two notes for AIP-132 phase 1 that need no change in this PR:
- Remote to remote goes through
open(), and on FTP that is one data connection per block._cp_fileisshutil.copyfileobjbetween two opened files. Against the local server, reading 8 MiB that way took 32RETR(each withREST) and 31ABOR, wherefs.get_filetook oneRETR; writing 1 MiB took 5STORwithREST. That is roughly 4,000 data connections and aborts per GiB forFTPToS3, and the write side needs a server that acceptsRESTbeforeSTOR. Local to FTP and FTP to local are not affected (put/get). Something for the grownFileTransferOperatorto handle (a largerblock_size, or a spooledget_file/put_filefor FTP ends) and for the shared behaviour suite to cover. Timings on localhost say nothing about a real server, so I give only the command counts. - FTPS. Leaving it out is right for this PR. For the record: fsspec has had
tls=since 2024.9.0, callsprot_p()once in__init__but not after a reconnect, and buildsFTP_TLSwithout the verified contextFTPSHookpasses. None of the 28 phase 1 operators usesFTPSHook(FTPToS3OperatorandS3ToFTPOperatoruseFTPHook).
The pass: head b4965c0ceb, diff-based, with the unchanged callers read at that commit (task-sdk/src/airflow/sdk/io/{fs,store,path}.py, FTPHook, the sftp fs module) and fsspec's implementations/ftp.py. The change matches the AIP's phase 1 row for ftp (an fs module plus the provider.yaml entry, as sftp did). Parity with FTPHook.get_conn checked field by field: host, port default, anonymous login, passive (same helper, applied on every _connect), encoding; the only difference is fsspec's 30 s socket timeout, which the hook does not set. All mocks in the tests carry a spec; nothing names a reviewer. Probes run: path resolution through ObjectStoragePath with a mocked ftplib.FTP, and reads, writes, copy, active mode (the server saw PORT, no PASV) and the idle timeout against pyftpdlib. The PR's unit tests were not run locally; fork CI ran them.
bdab678 to
f1aa05e
Compare
dabla
left a comment
There was a problem hiding this comment.
Addressed
- URL host ignored, docs said otherwise (thread): fixed in
78c3c52046. The page now says host and port come from the connection and the example isftp://my_conn@/data/file.csv. - Same-connection copy not documented (thread): fixed in
78c3c52046, with the note that a move works. fsspecnot declared (thread):fsspec>=2023.10.0is inproviders/ftp/pyproject.toml, with the regenerated README, docs index anduv.lock.- Dead control connection read as an empty folder (thread): fixed in
78c3c52046andf1aa05e727. I re-ran the first round's scenario against the head's_AirflowFTPFileSystem(pyftpdlib, 2 s idle timeout): after the idle periodls("/sub")lists the file, a read returns the bytes andexists()is right; with the server stopped the call raisesConnectionRefusedError, and once the server is back the next call reconnects and reads. Every method of fsspec's FTP filesystem that sends a command goes through_ensure_connected; the one path left out (reads and writes on an already open file) is named in the docstring.
Open
- [2] directory listings are cached without expiry in a filesystem that lives as long as the process, so files created by others are not seen (warning).
- [1]
passiveas a string is not normalised without a connection id (nit). - CI: green, 12 passed, nothing pending; the PR is no longer a draft.
The pass: head f1aa05e727, diff-based, whole change re-read (not only the two fix commits), with fsspec's implementations/ftp.py and spec.py for the listing cache. The four first-round threads were each re-run or re-read against the head as listed above. Override signatures checked against the parent's callers (AbstractFileSystem.open passes block_size, autocommit and cache_options by keyword, so the narrower _open signature is safe). All mocks in the tests carry a spec; nothing in the change, the commit messages or the PR body names a reviewer. The PR's unit tests were not run locally; fork CI ran them.
b870543 to
c50aa86
Compare
dabla
left a comment
There was a problem hiding this comment.
Addressed
- Stale directory listings (thread): fixed in
c50aa868fa. Listings now expire after 10 seconds by default. Re-run against the head's filesystem on a local pyftpdlib server: a file created by another client was seen byexists()after 10.0 s, and after the server's idle timeout plus the expirylsreconnected and listed both files.use_listings_cache=Falseand a customlistings_expiry_timeare still accepted. The docs state the default, the truncated read of a file rewritten inside the window (I gotb'abc'for a file rewritten to ten bytes, and the full content afterinvalidate_cache()), and the way out. passiveas a string without a connection id (thread): fixed inc50aa868fa, parsed once in__init__. With no connection id,"false"andFalsenow give active mode (the server sawPORT),"true"andTruepassive (PASV).
Open
- [1] the name of the filesystem class (nit).
- CI: all tests are green on this head, fork CI tests included (11 checks passed); only the "Mergeable" policy check is pending.
The pass: head c50aa868fa, diff-based, the whole change re-read and both second-round scenarios re-run as listed above. The idle-plus-expiry run shows that the ls override treats an expired listing as a miss and checks the connection first. All mocks in the tests carry a spec; nothing in the change, the commit messages or the PR body names a reviewer. The PR's unit tests were not run locally; fork CI ran them.
This lets
ObjectStoragePathwork with FTP paths such asftp://my_conn@/data/file.csv, using the FTP implementation that ships with fsspec. It is the first step for the FTP operators in phase 1 of AIP-132.It reads the host, port, login and password from the FTP connection, along with the
passiveandencodingextras. fsspec has no option for active mode, so a small subclass appliespassiveon every connect. The same subclass checks the control connection before each command it sends and reconnects when the server has closed it. FTPS is left out, since fsspec does not re-applyprot_p()after a reconnect and does not verify the server certificate the wayFTPSHookdoes.Testing
cc @dabla
Was generative AI tooling used to co-author this PR?
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.