From unknown Sun Jun 22 11:35:03 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#71295 <71295@debbugs.gnu.org> To: bug#71295 <71295@debbugs.gnu.org> Subject: Status: 29.3; url-retrieve-synchronously does not timeout if initial connection hangs Reply-To: bug#71295 <71295@debbugs.gnu.org> Date: Sun, 22 Jun 2025 18:35:03 +0000 retitle 71295 29.3; url-retrieve-synchronously does not timeout if initial = connection hangs reassign 71295 emacs submitter 71295 "Aaron Zeng" severity 71295 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri May 31 12:22:42 2024 Received: (at submit) by debbugs.gnu.org; 31 May 2024 16:22:42 +0000 Received: from localhost ([127.0.0.1]:55221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sD51d-0006Ex-5J for submit@debbugs.gnu.org; Fri, 31 May 2024 12:22:42 -0400 Received: from lists.gnu.org ([209.51.188.17]:51938) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sD51Y-0006Em-4r for submit@debbugs.gnu.org; Fri, 31 May 2024 12:22:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sD51M-0001mS-IO for bug-gnu-emacs@gnu.org; Fri, 31 May 2024 12:22:24 -0400 Received: from fout7-smtp.messagingengine.com ([103.168.172.150]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sD51J-0001l5-0H for bug-gnu-emacs@gnu.org; Fri, 31 May 2024 12:22:24 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfout.nyi.internal (Postfix) with ESMTP id DA9BB1380094; Fri, 31 May 2024 12:22:18 -0400 (EDT) Received: from imap46 ([10.202.2.96]) by compute4.internal (MEProxy); Fri, 31 May 2024 12:22:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bcc32.com; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:subject:subject:to:to; s=fm3; t=1717172538; x=1717258938; bh=rXOLj/J9otlATfus7fLtOjENCqTsNkhv dXbv3AENplM=; b=fbBz3BKcN9YUWSQFr0i1Kq3nLEuejERmjKETEvBvm+6F4KJO rOX8IEGESKXBuuzGPCKxMlv/lJSnmCZ94Wq1fqvI6jBqvYFYTiBWRmRQIEDO4okO upQpJILVrV3E1fmfIrYRD+XKxt6OsReuDRK1Jgx0MCQD3CEF4U7eFv5a0/KQLIth Pj+ROf3D1siC1T3tYdYseY9I8FnscfWA7TxqzTz4cVv53p1ZOEaEI5Tg6tFQH2tM 5IXmNGCQvfoVdAfgTOl5isD6GxZyaAVTzJkYCRFGo34cgsK3cI7pXTLOro/D5vYn 0G2YJfWNmxNhjwTQ6/1jKoum0rsWWoAt50Sw7w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1717172538; x=1717258938; bh=rXOLj/J9otlATfus7fLtOjENCqTsNkhvdXb v3AENplM=; b=h9nPOoqBtAM6Q6FpG6kaIpjbROeODWqCk0x6DIhWEOUv8DYx7ve Lz3ma5WtKMCUFuMVjQPhUoy1yQWEAAJ3P5pMkmBc+Wf4PualHnK8HDBHKEB6gwPg syh+xWuUmb9WIx2DBA7KkEzBgakC7M5ArqGEkXw6DNRJ/LgH8eQ1UETByLx6ei/d dWFJKyiBvCI184Uv/haMDgHcz/6WxkW321zhrxNGWjPCfFxOfMUUtuhIvyd3Sv3T 9VsHUsLeRnjD6jil+quRxSzIU/BElArxbi0G9oNp4+fbk+d92u2ni3m2FGyZeaH8 w3yPA8DCoaLkw3WFuYLFrtix6MhQsA3MjTg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdekiedgleejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfffhffvvefutgesthdtre dtreertdenucfhrhhomhepfdetrghrohhnucgkvghnghdfuceoiiessggttgefvddrtgho mheqnecuggftrfgrthhtvghrnhepgeevieelteffleeigffggfffvdegfedtteettdegje ffhefgfeekfeegtdffhfeunecuffhomhgrihhnpehgohhoghhlvgdrtghomhenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpeiisegstggtfedvrd gtohhm X-ME-Proxy: Feedback-ID: iba994645:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 8D5C92A20077; Fri, 31 May 2024 12:22:18 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-491-g033e30d24-fm-20240520.001-g033e30d2 MIME-Version: 1.0 Message-Id: Date: Fri, 31 May 2024 12:21:55 -0400 From: "Aaron Zeng" To: bug-gnu-emacs@gnu.org Subject: 29.3; url-retrieve-synchronously does not timeout if initial connection hangs Content-Type: text/plain Received-SPF: pass client-ip=103.168.172.150; envelope-from=z@bcc32.com; helo=fout7-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, WEIRD_PORT=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit Cc: Aaron Zeng , azeng@janestreet.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) 1. emacs -Q 2. Evaluate the following in the *scratch* buffer: (url-retrieve-synchronously "http://google.com:81" nil nil 1) This does not time out in one second like the TIMEOUT argument specifies. Instead, in my observations it hangs for at least several minutes. This attempt also doesn't work: 3. (with-timeout (1) (url-retrieve-synchronously "http://google.com:81")) As a consequence of this, Spacemacs's attempted timeout during Emacs startup can take ages if one of the package archives is temporarily unreachable, for example due to a network firewall that is enabled at my site. Spacemacs attempts to timeout after only 5 seconds, but instead it takes minutes. In GNU Emacs 29.3 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.18.0, Xaw3d scroll bars) Windowing system distributor 'HC-Consult', version 11.0.12014000 System Description: NixOS 23.11 (Tapir) Configured using: 'configure --prefix=/nix/store/8r6lgsfyak1mr2gg3ka6zkffxswkj3wv-emacs-29.3 --disable-build-details --with-modules --with-x-toolkit=lucid --with-cairo --with-xft --with-compress-install --with-toolkit-scroll-bars --with-native-compilation --without-imagemagick --with-mailutils --without-small-ja-dic --with-tree-sitter --with-xinput2 --without-xwidgets --with-dbus --with-selinux' Configured features: CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XAW3D XDBE XIM XINPUT2 XPM LUCID ZLIB Important settings: value of $EMACSLOADPATH: value of $EMACSNATIVELOADPATH: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Org Minor modes in effect: windmove-mode: t global-evil-surround-mode: t evil-surround-mode: t evil-org-mode: t org-appear-mode: t org-modern-mode: t org-superstar-mode: t org-indent-mode: t pupo-mode: t purpose-mode: t evil-escape-mode: t global-display-line-numbers-mode: t global-vi-tilde-fringe-mode: t vi-tilde-fringe-mode: t recentf-mode: t eval-sexp-fu-flash-mode: t show-smartparens-global-mode: t show-smartparens-mode: t yas-global-mode: t yas-minor-mode: t indent-guide-global-mode: t indent-guide-mode: t dired-async-mode: t winner-mode: t flyspell-mode: t flycheck-pos-tip-mode: t global-flycheck-mode: t global-spacemacs-whitespace-cleanup-mode: t spacemacs-whitespace-cleanup-mode: t winum-mode: t volatile-highlights-mode: t vertico-mode: t unkillable-scratch: t global-undo-tree-mode: t undo-tree-mode: t global-term-cursor-mode: t term-cursor-mode: t save-place-mode: t savehist-mode: t persistent-scratch-autosave-mode: t pdf-occur-global-minor-mode: t org-wild-notifier-mode: t mode-line-bell-mode: t marginalia-mode: t global-ligature-mode: t ligature-mode: t Info-breadcrumbs-in-mode-line-mode: t global-hl-todo-mode: t global-fasd-mode: t global-evil-quickscope-always-mode: t evil-quickscope-always-mode: t global-anzu-mode: t anzu-mode: t envrc-global-mode: t envrc-mode: t editorconfig-mode: t global-column-enforce-mode: t clean-aindent-mode: t projectile-mode: t hybrid-mode: t which-key-mode: t spacemacs-leader-override-mode: t global-spacemacs-leader-override-mode: t company-mode: t global-corfu-mode: t corfu-mode: t csv-field-index-mode: t global-git-commit-mode: t shell-dirtrack-mode: t server-mode: t evil-mode: t evil-local-mode: t global-hl-line-mode: t xterm-mouse-mode: t global-auto-revert-mode: t which-function-mode: t minibuffer-depth-indicate-mode: t midnight-mode: t display-time-mode: t override-global-mode: t ido-vertical-mode: t global-page-break-lines-mode: t page-break-lines-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t column-number-mode: t line-number-mode: t auto-fill-function: #[128 \304\300\301#\207 [yas--auto-fill org-auto-fill-function :around nil apply] 5 advice] transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: /home/aaron/.emacs.d/elpa/29.3/develop/load-env-vars-20180511.2210/load-env-vars hides /home/aaron/.emacs.d/core/libs/forks/load-env-vars /home/aaron/.emacs.d/elpa/29.3/develop/spinner-1.7.4/spinner hides /home/aaron/.emacs.d/core/libs/spinner /nix/store/gxi8whqw0hp0h1c83hh5l171qzk98n5g-emacs-packages-deps/share/emacs/site-lisp/site-start hides /nix/store/8r6lgsfyak1mr2gg3ka6zkffxswkj3wv-emacs-29.3/share/emacs/site-lisp/site-start ~/.spacemacs.d/custom hides /nix/store/8r6lgsfyak1mr2gg3ka6zkffxswkj3wv-emacs-29.3/share/emacs/29.3/lisp/custom /home/aaron/.emacs.d/elpa/29.3/develop/transient-20240525.1118/transient hides /nix/store/8r6lgsfyak1mr2gg3ka6zkffxswkj3wv-emacs-29.3/share/emacs/29.3/lisp/transient /home/aaron/.emacs.d/elpa/29.3/develop/xref-1.7.0/xref hides /nix/store/8r6lgsfyak1mr2gg3ka6zkffxswkj3wv-emacs-29.3/share/emacs/29.3/lisp/progmodes/xref /home/aaron/.emacs.d/elpa/29.3/develop/hierarchy-20190425.842/hierarchy hides /nix/store/8r6lgsfyak1mr2gg3ka6zkffxswkj3wv-emacs-29.3/share/emacs/29.3/lisp/emacs-lisp/hierarchy /nix/store/gxi8whqw0hp0h1c83hh5l171qzk98n5g-emacs-packages-deps/share/emacs/site-lisp/elpa/let-alist-1.0.6/let-alist hides /nix/store/8r6lgsfyak1mr2gg3ka6zkffxswkj3wv-emacs-29.3/share/emacs/29.3/lisp/emacs-lisp/let-alist Features: (ahk-mode calc-fin calc-arith calccomp calc-undo magit-patch magit-subtree magit-gitignore magit-ediff helm-make ob-C ob-js ob-perl ob-python ob-scheme ob-sql ob-shell timezone orgit-forge orgit gravatar dns evil-nerd-commenter evil-nerd-commenter-operator evil-nerd-commenter-sdk smartparens-html sgml-mode facemenu embark-org embark-consult embark ffap dumb-jump popup lsp-zig lsp-yang lsp-yaml lsp-xml lsp-wgsl lsp-volar lsp-vimscript lsp-vhdl lsp-vetur lsp-verilog lsp-vala lsp-v lsp-typeprof lsp-ttcn3 lsp-trunk lsp-toml lsp-tilt lsp-tex lsp-terraform lsp-svelte lsp-steep lsp-sqls lsp-sql lsp-sorbet lsp-solidity lsp-solargraph lsp-semgrep lsp-rust lsp-ruff-lsp lsp-ruby-syntax-tree lsp-ruby-lsp lsp-rubocop lsp-rf lsp-remark lsp-racket lsp-r lsp-qml lsp-pyright lsp-pylsp json-mode json-snatcher smartparens-javascript js c-ts-common shell-pop semantic/ia semantic/analyze/refs semantic/db-find semantic/db-ref semantic/senator semantic/decorate pulse semantic/analyze semantic/sort semantic/scope semantic/analyze/fcn semantic/db semantic/ctxt semantic/format semantic/tag-ls semantic/find rustic-flycheck rustic-spellcheck rustic-expand rustic-lsp rustic-playground rustic-rustfix rustic-racer rustic-babel rustic-rustfmt rustic-comint rustic-clippy rustic-doc rustic-popup rustic-cargo rustic-compile xterm-color rustic-interaction rustic smartparens-rust rust-utils rust-prog-mode rust-mode rust-common rust-rustfmt org-projectile org-project-capture org-project-capture-backend org-category-capture org-capture dired-quick-sort ls-lisp calc-misc calc-yank calc-alg calc-ext calc-aent calc-menu tabify evil-ledger ledger-mode ledger-check ledger-texi ledger-test ledger-sort ledger-report ledger-reconcile ledger-occur ledger-fonts ledger-fontify ledger-state ledger-complete ledger-schedule ledger-xact ledger-post ledger-exec ledger-init ledger-navigate ledger-context ledger-commodities ledger-regex vertico-directory mailalias smtpmail textsec uni-scripts idna-mapping ucs-normalize uni-confusable textsec-check auto-highlight-symbol lsp-pyls lsp-pwsh lsp-purescript lsp-pls lsp-php lsp-perlnavigator lsp-perl lsp-openscad lsp-ocaml lsp-nushell lsp-nix lsp-nim lsp-nginx lsp-move lsp-mojo lsp-mint lsp-meson lsp-mdx lsp-marksman lsp-markdown lsp-magik lsp-lua lsp-lisp lsp-kotlin lsp-json lsp-jq lsp-idris lsp-haxe lsp-hack lsp-groovy lsp-graphql lsp-golangci-lint lsp-glsl lsp-gleam lsp-gdscript lsp-fsharp lsp-fortran lsp-eslint lsp-erlang lsp-emmet lsp-elm lsp-elixir lsp-dockerfile lsp-dhall lsp-d lsp-cypher lsp-cucumber lsp-css lsp-csharp lsp-crystal lsp-credo lsp-cobol lsp-cmake lsp-clojure lsp-clangd lsp-bufls lsp-beancount lsp-bash lsp-awk lsp-autotools lsp-astro lsp-asm lsp-ansible lsp-angular lsp-ada lsp-actionscript ccls ccls-member-hierarchy ccls-inheritance-hierarchy ccls-call-hierarchy ccls-tree ccls-code-lens ccls-semantic-highlight ccls-common helpful cc-langs trace info-look elisp-refs windmove shadow mail-extr emacsbug term/xterm xterm cal-move hippie-exp evil-surround mule-util nix-format ocamlformat whitespace consult-org misearch multi-isearch magit-extras cal-iso emacsql-sqlite-builtin evil-collection-magit-todos magit-todos pcre2el rxt re-builder face-remap macrostep-c cmacexp macrostep company-c-headers smartparens-c cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs company-shell flycheck-bashate shfmt reformatter org-eldoc evil-org org-appear org-download org-modern org-superstar toc-org org-indent image-file image-converter oc-basic zoom-frm frame-cmds frame-fns avoid spacemacs-purpose-popwin window-purpose-x imenu-list window-purpose window-purpose-fixes window-purpose-prefix-overload window-purpose-switch window-purpose-layout window-purpose-core evil-escape display-line-numbers vi-tilde-fringe persistent-soft list-utils pcache cl font-utils recentf company-capf overseer pkg-info epl auto-compile elisp-slime-nav flycheck-elsa flycheck-package package-lint eval-sexp-fu evil-lisp-state highlight-numbers parent-mode highlight-parentheses hideshow rainbow-delimiters smartparens-config smartparens-ruby smartparens-org smartparens-python smartparens-markdown smartparens-text smartparens loadhist yasnippet-snippets yasnippet ol-man org-checklist ol-eshell org-tempo ol-info org-habit ol-docview ol-bibtex bibtex indent-guide fancy-battery battery dired-async dired-aux cus-start bcc32-abbrev winner company-files company-keywords company-etags company-gtags company-dabbrev-code company-semantic flyspell window-purpose-configuration window-purpose-utils org-clock flycheck-pos-tip pos-tip flycheck-ledger flycheck evil-matchit evil-matchit-evil-setup evil-matchit-sdk spacemacs-whitespace-cleanup ws-butler winum volatile-highlights vertico-repeat vertico-quick vertico unkillable-scratch unicode-fonts undo-tree queue term-cursor symbol-overlay string-inflection saveplace savehist popwin persistent-scratch pdf-occur pdf-isearch pdf-misc pdf-loader diary-lib diary-loaddefs org-wild-notifier org-duration async alert log4e notifications dbus gntp org-rich-yank orderless mode-line-bell marginalia git-rebase ligature keycast info+ hl-todo fasd evil-unimpaired evil-textobj-line evil-quickscope evil-easymotion evil-collection-simple evil-collection-replace evil-collection-eww evil-collection-ediff evil-collection-dired evil-collection-magit evil-collection-forge evil-collection-buff-menu evil-anzu anzu eshell-z em-dirs esh-var em-term em-smart envrc inheritenv editorconfig editorconfig-core editorconfig-core-handle editorconfig-fnmatch drag-stuff dired-x consult-imenu column-enforce-mode clean-aindent-mode bcc32-org bcc32-org-lint org-lint ox-texinfo ox-org ox-latex ox-icalendar ox-gfm ox-md ox-html table ox-ascii ox-publish ox org-attach projectile ibuf-ext org-agenda org-element org-persist org-id avl-tree org-refile zenburn-theme-autoloads yasnippet-snippets-autoloads yapfify-autoloads yaml-mode-autoloads ws-butler-autoloads writeroom-mode-autoloads visual-fill-column-autoloads winum-autoloads window-purpose-autoloads imenu-list-autoloads wgrep-autoloads web-mode-autoloads web-beautify-autoloads volatile-highlights-autoloads vim-powerline-autoloads vi-tilde-fringe-autoloads vertico-autoloads uuidgen-autoloads utop-autoloads unkillable-scratch-autoloads unicode-fonts-autoloads ucs-utils-autoloads font-utils-autoloads persistent-soft-autoloads pcache-autoloads undo-tree-autoloads queue-autoloads typescript-mode-autoloads tuareg-autoloads caml-autoloads toml-mode-autoloads toc-org-autoloads tide-autoloads terminal-here-autoloads term-cursor-autoloads tao-theme-autoloads tagedit-autoloads symon-autoloads symbol-overlay-autoloads string-inflection-autoloads string-edit-at-point-autoloads sql-indent-autoloads spotify-autoloads sphinx-doc-autoloads spacemacs-whitespace-cleanup-autoloads spacemacs-purpose-popwin-autoloads space-doc-autoloads solarized-theme-autoloads smeargle-autoloads slim-mode-autoloads shfmt-autoloads reformatter-autoloads shell-pop-autoloads scss-mode-autoloads sass-mode-autoloads rustic-autoloads xterm-color-autoloads rust-mode-autoloads ron-mode-autoloads reveal-in-osx-finder-autoloads restart-emacs-autoloads rainbow-delimiters-autoloads quickrun-autoloads pytest-autoloads pylookup-autoloads pyenv-mode-autoloads pydoc-autoloads py-isort-autoloads pug-mode-autoloads prettier-js-autoloads posframe-autoloads popwin-autoloads poetry-autoloads pocket-reader-autoloads org-web-tools-autoloads esxml-autoloads rainbow-identifiers-autoloads ov-autoloads pocket-lib-autoloads plz-autoloads peg-autoloads kv-autoloads pippel-autoloads pipenv-autoloads load-env-vars-autoloads pyvenv-autoloads pip-requirements-autoloads persistent-scratch-autoloads pdf-tools-autoloads tablist-autoloads password-generator-autoloads paradox-autoloads ox-gfm-autoloads overseer-autoloads osx-trash-autoloads osx-clipboard-autoloads orgit-forge-autoloads orgit-autoloads org-wild-notifier-autoloads org-superstar-autoloads org-rich-yank-autoloads org-projectile-autoloads org-project-capture-autoloads org-category-capture-autoloads org-present-autoloads org-pomodoro-autoloads alert-autoloads log4e-autoloads gntp-autoloads org-mime-autoloads org-download-autoloads org-contrib-autoloads org-cliplink-autoloads org-appear-autoloads orderless-autoloads open-junk-file-autoloads ocp-indent-autoloads ocamlformat-autoloads npm-mode-autoloads nose-autoloads nodejs-repl-autoloads nix-mode-autoloads nano-agenda-autoloads nameless-autoloads multi-vterm-autoloads vterm-autoloads multi-term-autoloads multi-line-autoloads shut-up-autoloads mode-line-bell-autoloads merlin-iedit-autoloads merlin-eldoc-autoloads merlin-company-autoloads markdown-toc-autoloads magit-todos-autoloads macrostep-autoloads lsp-ui-autoloads lsp-pyright-autoloads lsp-origami-autoloads origami-autoloads lorem-ipsum-autoloads livid-mode-autoloads skewer-mode-autoloads live-py-mode-autoloads link-hint-autoloads ligature-autoloads launchctl-autoloads keycast-autoloads json-reformat-autoloads json-navigator-autoloads hierarchy-autoloads json-mode-autoloads json-snatcher-autoloads js2-refactor-autoloads multiple-cursors-autoloads js2-mode-autoloads js-doc-autoloads inspector-autoloads insert-shebang-autoloads info+-autoloads indent-guide-autoloads importmagic-autoloads epc-autoloads ctable-autoloads concurrent-autoloads impatient-mode-autoloads simple-httpd-autoloads ibuffer-projectile-autoloads hungry-delete-autoloads hl-todo-autoloads highlight-parentheses-autoloads highlight-numbers-autoloads parent-mode-autoloads highlight-indentation-autoloads hide-comnt-autoloads helpful-autoloads elisp-refs-autoloads helm-make-autoloads haml-mode-autoloads google-translate-autoloads google-c-style-autoloads golden-ratio-autoloads gnuplot-autoloads gitignore-templates-autoloads git-timemachine-autoloads git-modes-autoloads git-messenger-autoloads git-link-autoloads gh-md-autoloads gendoxy-autoloads geiser-guile-autoloads geiser-chicken-autoloads flyspell-correct-popup-autoloads flyspell-correct-autoloads flycheck-ycmd-autoloads flycheck-rtags-autoloads flycheck-pos-tip-autoloads pos-tip-autoloads flycheck-package-autoloads package-lint-autoloads flycheck-ocaml-autoloads merlin-autoloads flycheck-ledger-autoloads flycheck-elsa-autoloads flycheck-bashate-autoloads flycheck-autoloads flx-ido-autoloads flx-autoloads fish-mode-autoloads fasd-autoloads fancy-battery-autoloads explain-pause-mode-autoloads expand-region-autoloads evil-visualstar-autoloads evil-visual-mark-mode-autoloads evil-unimpaired-autoloads evil-tutor-autoloads evil-textobj-line-autoloads evil-surround-autoloads evil-quickscope-autoloads evil-org-autoloads evil-numbers-autoloads evil-nerd-commenter-autoloads evil-matchit-autoloads evil-lisp-state-autoloads evil-lion-autoloads evil-ledger-autoloads ledger-mode-autoloads evil-indent-plus-autoloads evil-iedit-state-autoloads evil-goggles-autoloads evil-exchange-autoloads evil-escape-autoloads evil-easymotion-autoloads evil-cleverparens-autoloads smartparens-autoloads evil-args-autoloads evil-anzu-autoloads anzu-autoloads eval-sexp-fu-autoloads eshell-z-autoloads eshell-prompt-extras-autoloads esh-help-autoloads envrc-autoloads inheritenv-autoloads emr-autoloads iedit-autoloads paredit-autoloads list-utils-autoloads emmet-mode-autoloads embark-consult-autoloads embark-autoloads elisp-slime-nav-autoloads elisp-def-autoloads editorconfig-autoloads eat-autoloads dune-autoloads dumb-jump-autoloads popup-autoloads drag-stuff-autoloads disaster-autoloads dired-quick-sort-autoloads devdocs-autoloads define-word-autoloads debbugs-autoloads cython-mode-autoloads cpp-auto-include-autoloads consult-yasnippet-autoloads consult-lsp-autoloads compleseus-spacemacs-help-autoloads company-ycmd-autoloads ycmd-autoloads pkg-info-autoloads epl-autoloads request-deferred-autoloads deferred-autoloads company-web-autoloads web-completion-data-autoloads company-shell-autoloads company-rtags-autoloads rtags-autoloads company-plsense-autoloads company-nixos-options-autoloads nixos-options-autoloads company-c-headers-autoloads company-anaconda-autoloads command-log-mode-autoloads column-enforce-mode-autoloads code-cells-autoloads clean-aindent-mode-autoloads clang-format-autoloads centered-cursor-mode-autoloads ccls-autoloads browse-at-remote-autoloads blacken-autoloads bcc32-org-autoloads projectile-autoloads auto-yasnippet-autoloads yasnippet-autoloads auto-highlight-symbol-autoloads auto-dictionary-autoloads auto-compile-autoloads anaconda-mode-autoloads pythonic-autoloads all-the-icons-autoloads ahk-mode-autoloads aggressive-indent-autoloads advent-of-code-autoloads request-autoloads ace-window-autoloads ace-link-autoloads avy-autoloads hybrid-mode evil-evilified-state pcre2el-autoloads hybrid-mode-autoloads holy-mode-autoloads evil-evilified-state-autoloads dotenv-mode-autoloads which-key diminish hydra bind-map which-key-autoloads hydra-autoloads diminish-autoloads bind-map-autoloads async-autoloads tempo make-mode ispell company-dabbrev company-template company company-autoloads consult consult-autoloads lsp-javascript lsp-html lsp-icons lsp-go lsp-completion lsp-semantic-tokens lsp-mode lsp-protocol lv ht f s lsp-mode-autoloads lv-autoloads spinner-autoloads ht-autoloads f-autoloads s-autoloads corfu corfu-autoloads csv-mode sort csv-mode-autoloads xwidget woman wdired vc-dir vc-annotate timer-list thread tetris gamegrid term disp-table ehelp tablist tablist-filter semantic/wisent/comp semantic/wisent semantic/wisent/wisent semantic/util-modes semantic/util semantic semantic/tag semantic/lex semantic/fw mode-local cedet speedbar ezimage dframe so-long shortdoc sh-script executable scroll-lock ruby-mode smie reftex-toc reftex-cite reftex-ref reftex-parse reftex reftex-loaddefs reftex-vars python treesit profiler proced pdf-history pdf-tools pdf-view pdf-cache pdf-info pdf-util pdf-macs newsticker newst-treeview tree-widget newst-plainview newst-reader newst-ticker newst-backend mpc man image-dired image-dired-tags image-dired-external image-dired-util ibuffer ibuffer-loaddefs grep finder eww xdg url-queue shr pixel-fill kinsoku url-file svg xml dom mm-url gnus nnheader range eshell em-prompt esh-mode esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util emoji multisession sqlite eglot external-completion array jsonrpc ert ewoc flymake-proc flymake ediff ediff-merg ediff-mult ediff-wind ediff-diff ediff-help ediff-init ediff-util edebug doc-view jka-compr image-mode exif dictionary dictionary-connection debug backtrace cus-theme calc calc-loaddefs calc-macs magit-bookmark bookmark apropos evil-collection annalist evil evil-keybindings evil-integration evil-collection-autoloads annalist-autoloads forge-repos forge-topics forge-tablist forge-commands forge-semi forge-bitbucket forge-gogs gogs forge-gitea gtea forge-gitlab glab forge-github forge-notify forge-revnote forge-pullreq forge-issue forge-topic yaml parse-time iso8601 forge-post markdown-mode color forge-repo forge forge-core forge-db closql emacsql-sqlite-common emacsql emacsql-compiler eieio-base magit-submodule magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log magit-diff smerge-mode diff git-commit log-edit add-log magit-core magit-autorevert magit-margin magit-transient magit-process with-editor shell server magit-mode transient magit-git magit-base magit-section cursor-sensor crm dash buck ghub-graphql treepy gsexp ghub let-alist forge-autoloads yaml-autoloads markdown-mode-autoloads magit-autoloads ghub-autoloads closql-autoloads emacsql-autoloads treepy-autoloads magit-section-autoloads git-commit-autoloads with-editor-autoloads transient-autoloads dash-autoloads geiser geiser-mode geiser-xref geiser-compile geiser-repl geiser-capf geiser-debug geiser-image geiser-doc geiser-menu geiser-autodoc geiser-edit etags fileloop generator xref geiser-completion geiser-eval geiser-connection tq geiser-syntax scheme geiser-log geiser-popup view geiser-impl help-fns geiser-custom geiser-base geiser-autoloads files-x project xref-autoloads htmlize-autoloads marginalia-autoloads org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src ob-comint org-pcomplete pcomplete org-list org-footnote org-faces org-entities noutline outline ob-emacs-lisp ob-core ob-eval org-cycle org-table ol org-fold org-fold-core org-keys oc org-loaddefs find-func cal-menu calendar cal-loaddefs org-version org-compat org-macs compat org-modern-autoloads compat-autoloads evil-maps evil-commands evil-digraphs reveal evil-jumps evil-command-window evil-types evil-macros evil-repeat evil-search evil-ex evil-states evil-core advice evil-common rect evil-vars compile comint ansi-osc ansi-color ring info evil-autoloads goto-addr thingatpt vc-hg vc-git diff-mode vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs log-view pcvs-util vc vc-dispatcher bug-reference loaddefs-gen lisp-mnt radix-tree tar-mode arc-mode archive-mode goto-chg-autoloads mm-archive message sendmail yank-media dired dired-loaddefs rfc822 mml mml-sec epa gnus-util text-property-search time-date mailabbrev gmm-utils mailheader mm-decode mm-bodies mm-encode mail-utils gnutls network-stream url-http mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr url-gw nsm puny url-cache url-auth thunk comp comp-cstr hl-line xt-mouse autorevert filenotify base16-material-theme base16-theme base16-theme-autoloads format-spec finder-inf which-func imenu mb-depth midnight time edmacro kmacro cl-extra use-package use-package-ensure use-package-delight use-package-diminish use-package-bind-key bind-key use-package-core ido-vertical-mode ido core-spacemacs core-use-package-ext core-spacebind core-transient-state core-micro-state core-toggle core-keybindings core-fonts-support core-themes-support core-display-init core-jump core-release-management core-custom-settings core-configuration-layer core-progress-bar core-spacemacs-buffer core-funcs spacemacs-ht inline help-mode warnings package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq password-cache json map url-vars eieio byte-opt eieio-core epg rfc6068 epg-config core-command-line core-debug derived core-hooks page-break-lines easy-mmode core-env load-env-vars rx core-dotspacemacs core-customization validate cus-edit pp cus-load icons wid-edit core-emacs-backports core-compilation pcase bytecomp byte-compile subr-x core-dumper spinner cl-macs gv cl-loaddefs cl-lib core-versions core-load-paths core-early-funcs rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo x-toolkit xinput2 x multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 4671079 1795666) (symbols 48 136824 51) (strings 32 784563 237321) (string-bytes 1 28448890) (vectors 16 290750) (vector-slots 8 6024368 5199382) (floats 8 2592 10865) (intervals 56 311712 55855) (buffers 984 134)) From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 01 15:41:13 2024 Received: (at 71295) by debbugs.gnu.org; 1 Jun 2024 19:41:13 +0000 Received: from localhost ([127.0.0.1]:57451 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sDUbI-0006rN-W5 for submit@debbugs.gnu.org; Sat, 01 Jun 2024 15:41:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37600) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sDUbG-0006rA-8N for 71295@debbugs.gnu.org; Sat, 01 Jun 2024 15:41:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sDUYr-0003aP-Je; Sat, 01 Jun 2024 15:38:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=zynSucyl44eIL7E8tsV+Zdwrzb5pRwn3hyh50JmNSG8=; b=CWJ5MOw3vrJn 1PwFSTrfS2gOxU5RDXrVD1Uo7Bzw0ZLW3rSquCMuUnb+et7AsbMaf4WK/tTYOtGq/8eeFmsizw42I 3KMYWfH9smHFSm3HZqfG5p/no0SkUHlKUGV79qPv0ZchfA2k5M2OP0QTnt74wku+akIFEYFX9eesr wZeHWKJSFKhAuo7zSxAEllwVk/Cd4NRhro7gfqNiGMT/5Il0AbZ3AFgxRvG8WpwiD9IqYI4QhwSLs VwcaRCBcanhR9/XmJqBYuORHa87rvK27A9zunIDhYdKlGpcpIfGq7obsB2CN4PBrHQndvvebKq5e4 3yUP6prc/Kq20EODmE41Gg==; Date: Sat, 01 Jun 2024 22:38:36 +0300 Message-Id: <86bk4ko3lv.fsf@gnu.org> From: Eli Zaretskii To: "Aaron Zeng" In-Reply-To: (z@bcc32.com) Subject: Re: bug#71295: 29.3; url-retrieve-synchronously does not timeout if initial connection hangs References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71295 Cc: 71295@debbugs.gnu.org, azeng@janestreet.com, z@bcc32.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: Aaron Zeng , azeng@janestreet.com > Date: Fri, 31 May 2024 12:21:55 -0400 > From: "Aaron Zeng" > > 1. emacs -Q > 2. Evaluate the following in the *scratch* buffer: > > (url-retrieve-synchronously "http://google.com:81" nil nil 1) > > This does not time out in one second like the TIMEOUT argument > specifies. Instead, in my observations it hangs for at least several > minutes. > > This attempt also doesn't work: > > > 3. (with-timeout (1) (url-retrieve-synchronously "http://google.com:81")) > > As a consequence of this, Spacemacs's attempted timeout during Emacs > startup can take ages if one of the package archives is temporarily > unreachable, for example due to a network firewall that is enabled at > my site. Spacemacs attempts to timeout after only 5 seconds, but > instead it takes minutes. The timeout cannot work when Emacs is stuck in a system call trying to initiate a network connection. That is blocking, unless you use url-retrieve asynchronously. The timeout starts working after the connection is established, so it basically protects against too slow downloading of data after the initial connection. I think it's a bug in Spacemacs that it attempts to solve connectivity problems this way. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 03 20:09:47 2024 Received: (at 71295) by debbugs.gnu.org; 4 Jun 2024 00:09:47 +0000 Received: from localhost ([127.0.0.1]:55970 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEHkJ-0008GJ-76 for submit@debbugs.gnu.org; Mon, 03 Jun 2024 20:09:47 -0400 Received: from fhigh7-smtp.messagingengine.com ([103.168.172.158]:52295) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEHkE-0008Fv-8m for 71295@debbugs.gnu.org; Mon, 03 Jun 2024 20:09:46 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfhigh.nyi.internal (Postfix) with ESMTP id F116E114014E; Mon, 3 Jun 2024 20:09:23 -0400 (EDT) Received: from imap46 ([10.202.2.96]) by compute4.internal (MEProxy); Mon, 03 Jun 2024 20:09:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bcc32.com; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1717459763; x=1717546163; bh=LrtRCnBWJJ mOPFwa5jmsTug7QAod+e+FygJ2riaCcsE=; b=A6MD7Qu6nbehMLBknU8FhAwGac VTUH0fetsfQKvGdTwIgQoz6s0ybhXV0NUjkXqvP8gC+Z/UsII2dEUkBYOPBBZ0el jPZ+p3TL3W9/DbEuokruJLQSNQiNG1Qr7d5LuD+tJCsgSQBKpaAyL+28plnlCxmB /ozhB8l2JzvGuGBj8Lj72ppEZ6/YvT8SO480RUSrylHtCAprsalMmsdB0jN7uzRd OZfmgH/BzLotNrUd9/EZGetrMOZpD4d0btMVIriGlHy8ceiFERM50vpfsuQLuaHl 01nJeuvofSCTXgdLwwygo4vscFAqPPnpgoC9e6R+pZCL+VCdE8jdGC7smoOg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1717459763; x=1717546163; bh=LrtRCnBWJJmOPFwa5jmsTug7QAod +e+FygJ2riaCcsE=; b=J4aq2Pz/iTZsc0vIBi5Wx+zTl0STWOabqBEHsHO6Ow9L aS27kFFBXE1QsBSUaICeRMuH2m4W2hiSo6ovK7R4y3Hp5bZ+lzkKmuOwPOs4b2N+ 6wxcAoHXeBZivdHOLSfek8h6UD/Z7aNHxPykkVKR/9qpXbKKzxe1k3Urg9Ivz6l2 N8colNm/mkQ1wuVKFQAhYapLRb9EnuXG5OmK6cxE5//BW+POXfHDSP5D/Qws43vS dyHaiQJPPKKPAIWll5N0De78PlEU9RhjLAfi344OYA90LZ6i9s7/9gmUfrsWUZFX 9BPeefeEiDsxM7AcQnpHy+mwOzWcrazh16BbU4W0zQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdelfedgfedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftegr rhhonhcukggvnhhgfdcuoeiisegstggtfedvrdgtohhmqeenucggtffrrghtthgvrhhnpe dtjedujeeffeduffdvtddvkefgvdefveejtdevkeeiieetuddtgefhueejtedtkeenucff ohhmrghinhepghhithhhuhgsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhepiiessggttgefvddrtghomh X-ME-Proxy: Feedback-ID: iba994645:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 9EBAA2A20077; Mon, 3 Jun 2024 20:09:23 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-491-g033e30d24-fm-20240520.001-g033e30d2 MIME-Version: 1.0 Message-Id: <19e5cb88-48a2-46a2-b9e9-c4a9c9198bb5@app.fastmail.com> In-Reply-To: <86bk4ko3lv.fsf@gnu.org> References: <86bk4ko3lv.fsf@gnu.org> Date: Mon, 03 Jun 2024 20:09:03 -0400 From: "Aaron Zeng" To: "Eli Zaretskii" Subject: Re: bug#71295: 29.3; url-retrieve-synchronously does not timeout if initial connection hangs Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71295 Cc: 71295@debbugs.gnu.org, azeng@janestreet.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On Sat, Jun 1, 2024, at 15:38, Eli Zaretskii wrote: > The timeout cannot work when Emacs is stuck in a system call trying to > initiate a network connection. That is blocking, unless you use > url-retrieve asynchronously. The timeout starts working after the > connection is established, so it basically protects against too slow > downloading of data after the initial connection. That makes sense, although it's not what I would have guessed from the docstring. > I think it's a bug in Spacemacs that it attempts to solve connectivity > problems this way. What would be a reasonable alternative? This is the same approximate method used by, e.g., request.el. See https://github.com/tkf/emacs-request/blob/01e338c335c07e4407239619e57361944a82cb8a/request.el#L767-L775. Is the idea just to use url-retrieve directly? I hacked together a quick function that doesn't seem to hang: (defun url-retrieve-synchronously-but-dont-hang (url &optional silent inhibit-cookies timeout) (with-timeout (timeout (error "Timed out retrieving %S after waiting for %s seconds" url timeout)) (let* (done (buf (url-retrieve url (lambda (&rest _) (setq done (current-buffer))) nil silent inhibit-cookies))) (when buf (let ((proc (get-buffer-process buf))) (while (accept-process-output proc)) done))))) This is probably rather naive of me, but I guess now I'm wondering why url-retrieve-synchronously actually sets url-asynchronous to nil. Is there a good reason not to use :nowait when it is available? It seems like it would be useful to have a wrapper around url-retrieve that just "does what I mean" here. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 06 07:40:36 2024 Received: (at 71295) by debbugs.gnu.org; 6 Jun 2024 11:40:36 +0000 Received: from localhost ([127.0.0.1]:52589 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFBTw-0006sP-0p for submit@debbugs.gnu.org; Thu, 06 Jun 2024 07:40:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36258) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFBTt-0006s7-CX for 71295@debbugs.gnu.org; Thu, 06 Jun 2024 07:40:34 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sFBTT-0007Ys-Ts; Thu, 06 Jun 2024 07:40:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=0zdLr4StGPxzdXnhEzLFLs3WfNUTIKr6cU6dd8OolLo=; b=PocSsTAtO5Yo Zbl2b3Xz+CfUlm0dqjaACiLE+pMV3oQe9SAcp3GvZWZXiZS5iH+7CdKtDCqN5vJ/0g460fkhqNRKF AVLzehLRNcer41njShkTDG9AhUWvEi1vGkRbQbrWnGwfxQNw3sQ4qVWVbTPuZQyXyG1vY7EUAPMZy 4R11ir0GCLmdhiGcmYEVRXBt1auCDxtdyD2eaDIiE+fp6QucOaY0aI803mcxn6FKyzXk5Dr6APtLT ltCbGzo0LDq1cNEgv7Qr1+6TLfu86OFBGHOhXoxsS0sgdOm55BMzWHrVRlIeALYca2ANudxQObjA1 fe6vqwh4ASkGsf9+VYbuRg==; Date: Thu, 06 Jun 2024 14:40:05 +0300 Message-Id: <86plsuguzu.fsf@gnu.org> From: Eli Zaretskii To: "Aaron Zeng" In-Reply-To: <19e5cb88-48a2-46a2-b9e9-c4a9c9198bb5@app.fastmail.com> (z@bcc32.com) Subject: Re: bug#71295: 29.3; url-retrieve-synchronously does not timeout if initial connection hangs References: <86bk4ko3lv.fsf@gnu.org> <19e5cb88-48a2-46a2-b9e9-c4a9c9198bb5@app.fastmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71295 Cc: 71295@debbugs.gnu.org, azeng@janestreet.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Mon, 03 Jun 2024 20:09:03 -0400 > From: "Aaron Zeng" > Cc: 71295@debbugs.gnu.org, azeng@janestreet.com > > Is the idea just to use url-retrieve directly? I think so, yes. > This is probably rather naive of me, but I guess now I'm wondering why url-retrieve-synchronously actually sets url-asynchronous to nil. Is there a good reason not to use :nowait when it is available? It seems like it would be useful to have a wrapper around url-retrieve that just "does what I mean" here. Maybe. I wonder what others think about this. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 06 16:51:40 2024 Received: (at 71295) by debbugs.gnu.org; 6 Jun 2024 20:51:41 +0000 Received: from localhost ([127.0.0.1]:40705 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFK5E-0006Rk-HH for submit@debbugs.gnu.org; Thu, 06 Jun 2024 16:51:40 -0400 Received: from wfout7-smtp.messagingengine.com ([64.147.123.150]:35505) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFK5B-0006RM-OL for 71295@debbugs.gnu.org; Thu, 06 Jun 2024 16:51:39 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailfout.west.internal (Postfix) with ESMTP id 159F31C00098; Thu, 6 Jun 2024 16:41:43 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 06 Jun 2024 16:41:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1717706502; x=1717792902; bh=o71wxHQ+5AFlak+h8g8b+9jIg/M0/PWww6rv45pk3e4=; b= Iclw2GjGoSzdpoPi7sFY2wLE+t/mKWvnbD/EkLMg77O+T+7b4XPVEzjmzbvd8uvp ntNelwjiCPJbiESjPHLy710a0WujkfIZFw5v1UKSgPwm1aAI2VNDE/AtElkBpGDk 25iJ8+l0F1bW47pXp5WlrRAurCiZvlYmMPlpJQ7cb0urlBAYjipcrcv8nu1Uvhoc 799HVBQwWXKw96I8sgm98UlN+01W7agT/cAmEcJZIE7QazqxSaH93CvcIXONsV5J FGf25QmwmFCgAJ3tQNFG+f8leuEhGaBDp7E6tmUG/mQCB+K1/P4oHNDzttxX3e/S D7u0hRbhLymZtlnIMVAt6Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1717706502; x= 1717792902; bh=o71wxHQ+5AFlak+h8g8b+9jIg/M0/PWww6rv45pk3e4=; b=c lXjSxNxkH/I0u/FjnmNtd52JtPRfuM18TtdZLV8Y9r5LWTkUwasPX6kn3927JAVJ OYqro+hgCPBHe2e79iGOAw5zP4NI9MjbsTywwVvj5DBC7sKWkXsUnSRrmFkjiFXp RKHEV/EhZBpqfhcYblWNMen+sEXJlPN0X9IIs37mCRGQ/I+evKnqwpfZ2JdQhNEk GYol8b18RfBXsO28Lv861HfdWL/zhxL0xG1GHPgb5hjHT1kLeI1qUT4hpipYWeD2 nK1yCYB9vQdo0XXQFoKZEVwxGmyD/UKXmCyDPW3NowWNStDSFGcKicCgmBd/pdJE Uyihpk/dP5QrYaYMEK1aw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdelkedgudehtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrg htthgvrhhnpeetudeljeegheetgfehgeejkeeuhedvveeikeeufedtvddtveefhfdvveeg udejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 6 Jun 2024 16:41:41 -0400 (EDT) Message-ID: Date: Thu, 6 Jun 2024 23:41:39 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#71295: 29.3; url-retrieve-synchronously does not timeout if initial connection hangs To: Eli Zaretskii , Aaron Zeng References: <86bk4ko3lv.fsf@gnu.org> <19e5cb88-48a2-46a2-b9e9-c4a9c9198bb5@app.fastmail.com> <86plsuguzu.fsf@gnu.org> Content-Language: en-US From: Dmitry Gutov In-Reply-To: <86plsuguzu.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71295 Cc: 71295@debbugs.gnu.org, azeng@janestreet.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 06/06/2024 14:40, Eli Zaretskii wrote: >> This is probably rather naive of me, but I guess now I'm wondering why url-retrieve-synchronously actually sets url-asynchronous to nil. Is there a good reason not to use :nowait when it is available? It seems like it would be useful to have a wrapper around url-retrieve that just "does what I mean" here. > Maybe. I wonder what others think about this. It seems like a leaky abstraction (the caller has to be aware that what happens under the covers is done in several steps, and the timeout only applies to subsequent ones). If we could change the implementation to a more intuitive behavior, that would be a win, I think. Can somebody think of adverse effects? From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 07 02:20:39 2024 Received: (at 71295) by debbugs.gnu.org; 7 Jun 2024 06:20:39 +0000 Received: from localhost ([127.0.0.1]:53300 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFSxq-000876-Vn for submit@debbugs.gnu.org; Fri, 07 Jun 2024 02:20:39 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFSxn-00086d-4x for 71295@debbugs.gnu.org; Fri, 07 Jun 2024 02:20:36 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sFSxR-0007n6-Aj; Fri, 07 Jun 2024 02:20:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=FKR8scAPxzeJyJ5Ttg6/YbdQMQZnnqXd4F28LcnRZy0=; b=mL8eOh+pVsWU h9SdDY/85WIRjWH8fh3XobMLRYyDs41dAm6Xx9OHpORfn81EOWpy938By4TQZ/PUaw78X6D7Khq2+ +Dw0XaGsbxbrK6JIWOT9QozRAycda4ywoSds+jFM2+XTdLLbQ1ujGlTlWcdisZD77/zpk1J2P9qYy BGgOEeHKic52sE/7gRjKEulGH1f7GiQQPDHp9MKVlGapGXSF1r70G0/FyFtt1AeGlppCs3OgGiwim lRnIrGA+T874s5P4+3i76EBT44oeVJS6yT37hSXWaD17tewX8GRLFm0EEDLinGS26w7MFs+ghB0cj AA4uJcShBGQ7vMEe8puo1A==; Date: Fri, 07 Jun 2024 09:20:11 +0300 Message-Id: <86sexpff50.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-Reply-To: (message from Dmitry Gutov on Thu, 6 Jun 2024 23:41:39 +0300) Subject: Re: bug#71295: 29.3; url-retrieve-synchronously does not timeout if initial connection hangs References: <86bk4ko3lv.fsf@gnu.org> <19e5cb88-48a2-46a2-b9e9-c4a9c9198bb5@app.fastmail.com> <86plsuguzu.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71295 Cc: z@bcc32.com, 71295@debbugs.gnu.org, azeng@janestreet.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Thu, 6 Jun 2024 23:41:39 +0300 > Cc: 71295@debbugs.gnu.org, azeng@janestreet.com > From: Dmitry Gutov > > On 06/06/2024 14:40, Eli Zaretskii wrote: > >> This is probably rather naive of me, but I guess now I'm wondering why url-retrieve-synchronously actually sets url-asynchronous to nil. Is there a good reason not to use :nowait when it is available? It seems like it would be useful to have a wrapper around url-retrieve that just "does what I mean" here. > > Maybe. I wonder what others think about this. > > It seems like a leaky abstraction (the caller has to be aware that what > happens under the covers is done in several steps, and the timeout only > applies to subsequent ones). > > If we could change the implementation to a more intuitive behavior, that > would be a win, I think. Can somebody think of adverse effects? Do you have a patch to consider? From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 07 17:41:27 2024 Received: (at 71295) by debbugs.gnu.org; 7 Jun 2024 21:41:27 +0000 Received: from localhost ([127.0.0.1]:36918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFhKx-0007Ti-Dp for submit@debbugs.gnu.org; Fri, 07 Jun 2024 17:41:27 -0400 Received: from fout3-smtp.messagingengine.com ([103.168.172.146]:36767) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFhKv-0007TJ-6D for 71295@debbugs.gnu.org; Fri, 07 Jun 2024 17:41:26 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.nyi.internal (Postfix) with ESMTP id 2F72B13800AD; Fri, 7 Jun 2024 17:32:50 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 07 Jun 2024 17:32:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1717795970; x=1717882370; bh=bjxB93sguKqR7B5qEeN7Fe8fT747LSMXoV9jmPnt5o4=; b= PfJ6HwTxRGTmlY4tWGFL197cYn6iapVrO3i5AkGEHhHePpZl7nLIqx8C4g+8DbXl PbEkR4aU0207nETbjsBd7E3DrViF/CXXVcNbA5aTYKCRTD5GcgBrrmlmdapzjFsW 6455Ozy6kYs6ggFY1m2wNlcSl5LghRMR4jOyrB7hrlRg9XDkRsM+ZDZgh2VoQnyq rmPRCB+xgT7i8KRnA9zxDPOgmCv/wEmz+O1g9n3UsrZIXbE3IfpqLa1d257lEf08 KLsNHfCe+dQbaHwcHYyjqiMCQOI3uocabd7nk1UrZ2n3HlinVcLN8POk4TAyLd5V 7Tn1qUCc9yXbciAysPQB7g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1717795970; x= 1717882370; bh=bjxB93sguKqR7B5qEeN7Fe8fT747LSMXoV9jmPnt5o4=; b=D DY3AsEvhk75GMn1/75NklzBTSEjBlStHvU1oTYI9ilkd0JeKB4Ki609GY+KdipgP ZbR/ppzcTvacIdLbOVL+CZhRu8ZJ3xhYvvMuR+GeDUc35zLgigqGcsWz7AjNAMzY uSbk2NhbC/28pIV285/F5sqaztcaYp9AkK2b+6gj0HSUp0k1StREpUVpSZKDQ5vH EAw1SbfIPvDpX+cIo0S4SW73gUbsp2Dvn1XADI9YKDkY+9gcwn4xiglmTlbsij5F /CqlP/2ie7suZ3CYoPX5/ttS+nZ9Vk6GYsC1qIVye0fuTBODjqbhIRPMB7H1MoO6 FNKJajOwElLB39+iifqmg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedtuddgudefjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrg htthgvrhhnpeetudeljeegheetgfehgeejkeeuhedvveeikeeufedtvddtveefhfdvveeg udejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 7 Jun 2024 17:32:48 -0400 (EDT) Message-ID: <362fabaa-0b96-42eb-8b97-b17a86a121cb@gutov.dev> Date: Sat, 8 Jun 2024 00:32:44 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#71295: 29.3; url-retrieve-synchronously does not timeout if initial connection hangs To: Eli Zaretskii References: <86bk4ko3lv.fsf@gnu.org> <19e5cb88-48a2-46a2-b9e9-c4a9c9198bb5@app.fastmail.com> <86plsuguzu.fsf@gnu.org> <86sexpff50.fsf@gnu.org> Content-Language: en-US From: Dmitry Gutov In-Reply-To: <86sexpff50.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71295 Cc: z@bcc32.com, 71295@debbugs.gnu.org, azeng@janestreet.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 07/06/2024 09:20, Eli Zaretskii wrote: >> Date: Thu, 6 Jun 2024 23:41:39 +0300 >> Cc:71295@debbugs.gnu.org,azeng@janestreet.com >> From: Dmitry Gutov >> >> On 06/06/2024 14:40, Eli Zaretskii wrote: >>>> This is probably rather naive of me, but I guess now I'm wondering why url-retrieve-synchronously actually sets url-asynchronous to nil. Is there a good reason not to use :nowait when it is available? It seems like it would be useful to have a wrapper around url-retrieve that just "does what I mean" here. >>> Maybe. I wonder what others think about this. >> It seems like a leaky abstraction (the caller has to be aware that what >> happens under the covers is done in several steps, and the timeout only >> applies to subsequent ones). >> >> If we could change the implementation to a more intuitive behavior, that >> would be a win, I think. Can somebody think of adverse effects? > Do you have a patch to consider? This seems to work: diff --git a/lisp/url/url.el b/lisp/url/url.el index dea251b453b..3b4021ceca8 100644 --- a/lisp/url/url.el +++ b/lisp/url/url.el @@ -235,7 +235,7 @@ url-retrieve-synchronously TIMEOUT is passed, it should be a number that says (in seconds) how long to wait for a response before giving up." (url-do-setup) - (let* (url-asynchronous + (let* ((url-asynchronous t) data-buffer (callback (lambda (&rest _args) (setq data-buffer (current-buffer)) At first I was going to suggest the patch which reduces to Aaron's url-retrieve-synchronously-but-dont-hang implementation, but it misses the process cleanup stuff. The above change seems more harmless. In my brief testing anyway. From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 08 02:09:07 2024 Received: (at 71295) by debbugs.gnu.org; 8 Jun 2024 06:09:07 +0000 Received: from localhost ([127.0.0.1]:46415 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFpGF-00071G-Bl for submit@debbugs.gnu.org; Sat, 08 Jun 2024 02:09:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33426) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFpGC-00070Z-72 for 71295@debbugs.gnu.org; Sat, 08 Jun 2024 02:09:05 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sFpFq-00015Z-RG; Sat, 08 Jun 2024 02:08:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=L4wbw8tofxCcnXtmYRdzE7plCijSDXfQvfMYMlxZXmw=; b=GxYYAzsGY/VM 8yePM3oKTPXj00QwtuSCeiKtc4KejFI6dhNFLzmoekzZQtycGXmf+lAKH8UieI1NILUhP9KvGyRop Oewt7Iau/g2c7WUxRxy2AFd/raHTENpE5Ctm72Gv+bmvFuglOC02TfFxxtonQ/AYQQuApHoAh1KVq 0lNyIQyHRLnlCplDWhVLNNLCOHUQxZ6abKV+HWMswqLATYfamfZgVR9Qaxb3NjdMcNeLoXK3jDL2R 5sqhNEPvmxwOPQi6IbZD3BamXmRzSXGKI7CD2MT8+0QghlbpvZ6aPPqaT1A3fGcX261ifhWG/qcFe tZU25yxd6HSCpObBaGVJlQ==; Date: Sat, 08 Jun 2024 09:08:39 +0300 Message-Id: <86r0d8dl08.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-Reply-To: <362fabaa-0b96-42eb-8b97-b17a86a121cb@gutov.dev> (message from Dmitry Gutov on Sat, 8 Jun 2024 00:32:44 +0300) Subject: Re: bug#71295: 29.3; url-retrieve-synchronously does not timeout if initial connection hangs References: <86bk4ko3lv.fsf@gnu.org> <19e5cb88-48a2-46a2-b9e9-c4a9c9198bb5@app.fastmail.com> <86plsuguzu.fsf@gnu.org> <86sexpff50.fsf@gnu.org> <362fabaa-0b96-42eb-8b97-b17a86a121cb@gutov.dev> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71295 Cc: z@bcc32.com, 71295@debbugs.gnu.org, azeng@janestreet.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sat, 8 Jun 2024 00:32:44 +0300 > Cc: z@bcc32.com, 71295@debbugs.gnu.org, azeng@janestreet.com > From: Dmitry Gutov > > On 07/06/2024 09:20, Eli Zaretskii wrote: > >> Date: Thu, 6 Jun 2024 23:41:39 +0300 > >> Cc:71295@debbugs.gnu.org,azeng@janestreet.com > >> From: Dmitry Gutov > >> > >> It seems like a leaky abstraction (the caller has to be aware that what > >> happens under the covers is done in several steps, and the timeout only > >> applies to subsequent ones). > >> > >> If we could change the implementation to a more intuitive behavior, that > >> would be a win, I think. Can somebody think of adverse effects? > > Do you have a patch to consider? > > This seems to work: > > diff --git a/lisp/url/url.el b/lisp/url/url.el > index dea251b453b..3b4021ceca8 100644 > --- a/lisp/url/url.el > +++ b/lisp/url/url.el > @@ -235,7 +235,7 @@ url-retrieve-synchronously > TIMEOUT is passed, it should be a number that says (in seconds) > how long to wait for a response before giving up." > (url-do-setup) > - (let* (url-asynchronous > + (let* ((url-asynchronous t) > data-buffer > (callback (lambda (&rest _args) > (setq data-buffer (current-buffer)) Fine by me to install this on master, but please add there a comment explaining why we do that disregarding the "synchronously" part of the API's name. Did you consider binding url-asynchronous non-nil only if TIMEOUT is omitted or nil? That could be even better, since the risk of breaking something is lower, and OTOH if TIMEOUT is not passed, the original problem does not exist and waiting "forever" is justified. WDYT? From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 08 18:34:33 2024 Received: (at 71295) by debbugs.gnu.org; 8 Jun 2024 22:34:34 +0000 Received: from localhost ([127.0.0.1]:44440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sG4dt-00061m-Jw for submit@debbugs.gnu.org; Sat, 08 Jun 2024 18:34:33 -0400 Received: from fout2-smtp.messagingengine.com ([103.168.172.145]:51961) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sG4do-00061J-3Y for 71295@debbugs.gnu.org; Sat, 08 Jun 2024 18:34:31 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfout.nyi.internal (Postfix) with ESMTP id 83B5213800A6; Sat, 8 Jun 2024 18:34:06 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sat, 08 Jun 2024 18:34:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1717886046; x=1717972446; bh=6aMAn5Ypqpehk3qXriSJZezYbLNFS5n9OWv+HRbQTzw=; b= esTD4P+ovGUYb388ljWAFbvpKw7KEAyqxCejf+wSMNv5YSL9N8xv3aMhdc/MK5Fw djnyYxA9gJ05IXgj/GfkL9eJBYAurbaT75deir564cNADylJWwQmuh34fU+YfOVy KwZ5Mhjh4LsRDntST5W/ry6kRT95L8g925lAnYZvA1WAx5xnbYyedV9zrMm0y5UU 2X5MWg3KNZzffbr0CUFeyeW3O1QUBkhylXpljJegiJva93HrbkGpM2aFyNva8kfi NS+5Hkr8mCUSQoYMhznmaQdkmpimlohecZfT6vA8ZPDr8Sg0um1vhaiuxaRsc9L9 1nSHsVyqZ3XU/H6r1H2qLg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1717886046; x= 1717972446; bh=6aMAn5Ypqpehk3qXriSJZezYbLNFS5n9OWv+HRbQTzw=; b=Y NeqAna6dbfyrjy06LoKydggE3JzicmGawDsgiCc27FVzjyp3jy9G4OvFyM4jp+ZN DhSIt8GbIDx3HaNDUUoOkE/0PbdQQIMByyU6pDHwaC+HWUf4HlI1qwwtsdgzbTso xWfiiTDulhsUVgwk2jS21UvKyRmGcKL54LvNKN6PthyMdBDOgpHB9OhMlF5BfV4/ 2ppJl58XBAijR9n5rO+cRh/ur196DJSPdx/Fi/0aaj7dH2TVI624nb+yREVgYcCE XdLiGVMtl+Lb+/hxO94JkDYenBOz7jfTOn+VhliMzD4ut871qFyb+6gSNOtjq+F0 +/bFYKHdWxiLod8onHKJg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedthedguddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepteduleejgeehtefgheegjeekueehvdevieekueeftddvtdevfefhvdevgedu jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 8 Jun 2024 18:34:04 -0400 (EDT) Message-ID: <57c87a3e-d2bc-45aa-9c67-5ad62e82481f@gutov.dev> Date: Sun, 9 Jun 2024 01:34:03 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#71295: 29.3; url-retrieve-synchronously does not timeout if initial connection hangs To: Eli Zaretskii References: <86bk4ko3lv.fsf@gnu.org> <19e5cb88-48a2-46a2-b9e9-c4a9c9198bb5@app.fastmail.com> <86plsuguzu.fsf@gnu.org> <86sexpff50.fsf@gnu.org> <362fabaa-0b96-42eb-8b97-b17a86a121cb@gutov.dev> <86r0d8dl08.fsf@gnu.org> Content-Language: en-US From: Dmitry Gutov In-Reply-To: <86r0d8dl08.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71295 Cc: z@bcc32.com, 71295@debbugs.gnu.org, azeng@janestreet.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 08/06/2024 09:08, Eli Zaretskii wrote: >> This seems to work: >> >> diff --git a/lisp/url/url.el b/lisp/url/url.el >> index dea251b453b..3b4021ceca8 100644 >> --- a/lisp/url/url.el >> +++ b/lisp/url/url.el >> @@ -235,7 +235,7 @@ url-retrieve-synchronously >> TIMEOUT is passed, it should be a number that says (in seconds) >> how long to wait for a response before giving up." >> (url-do-setup) >> - (let* (url-asynchronous >> + (let* ((url-asynchronous t) >> data-buffer >> (callback (lambda (&rest _args) >> (setq data-buffer (current-buffer)) > > Fine by me to install this on master, but please add there a comment > explaining why we do that disregarding the "synchronously" part of the > API's name. > > Did you consider binding url-asynchronous non-nil only if TIMEOUT is > omitted or nil? That could be even better, since the risk of breaking > something is lower, and OTOH if TIMEOUT is not passed, the original > problem does not exist and waiting "forever" is justified. WDYT? That's a good idea. Pushed to master, with this addition and a comment. Thinking further, though, our ability to do so bring the existence of this variable into question (we only change it in url-retrieve-synchronously). I see it's been added as part of bug#26835 resolution, so maybe we'll need to re-examine that fix. From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 09 00:47:47 2024 Received: (at 71295) by debbugs.gnu.org; 9 Jun 2024 04:47:47 +0000 Received: from localhost ([127.0.0.1]:38136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGAT4-0006u8-MH for submit@debbugs.gnu.org; Sun, 09 Jun 2024 00:47:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56020) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGAT1-0006tS-0V for 71295@debbugs.gnu.org; Sun, 09 Jun 2024 00:47:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sGALD-0003Ug-CH; Sun, 09 Jun 2024 00:39:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=v5m7/ul16Z+KAh+swen3fsJlSHjA9QbkinGRCc3VJzE=; b=NrfCVXTqLiih NyYZYt4HM8npjf+o8DNhFvXUcyuYUSpfSbfCbzF8Z8EeAKuqcjR68SGyFYdjnW+YBVxAAvto/gqhW zYJ8u9GqBnCE3i6NpgiI8fGYEb04Z+fHPaupxPlfMgtxQ8mJqnt1PZWXEJlDbq18HVuyy1bGJn9Fa pnABQ1BFVBhJCr1kXst6YJ3nI7C/7OIjCMEwJ6QFK+Kw0g6CCrGEVRF6XVt9kIdiX7sEfsQuA1+r1 L48SAP6eCT9It+5TANwRvCMxL1NSVJm5ArKGpla8EFIexAvT1Fpn/XVw2NA+YnwCaVTrC1Z3k/GR5 AEucmO4AndomV73/qm1EOA==; Date: Sun, 09 Jun 2024 07:39:37 +0300 Message-Id: <86frtmbugm.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-Reply-To: <57c87a3e-d2bc-45aa-9c67-5ad62e82481f@gutov.dev> (message from Dmitry Gutov on Sun, 9 Jun 2024 01:34:03 +0300) Subject: Re: bug#71295: 29.3; url-retrieve-synchronously does not timeout if initial connection hangs References: <86bk4ko3lv.fsf@gnu.org> <19e5cb88-48a2-46a2-b9e9-c4a9c9198bb5@app.fastmail.com> <86plsuguzu.fsf@gnu.org> <86sexpff50.fsf@gnu.org> <362fabaa-0b96-42eb-8b97-b17a86a121cb@gutov.dev> <86r0d8dl08.fsf@gnu.org> <57c87a3e-d2bc-45aa-9c67-5ad62e82481f@gutov.dev> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71295 Cc: z@bcc32.com, 71295@debbugs.gnu.org, azeng@janestreet.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 9 Jun 2024 01:34:03 +0300 > Cc: z@bcc32.com, 71295@debbugs.gnu.org, azeng@janestreet.com > From: Dmitry Gutov > > Thinking further, though, our ability to do so bring the existence of > this variable into question (we only change it in > url-retrieve-synchronously). > > I see it's been added as part of bug#26835 resolution, so maybe we'll > need to re-examine that fix. Maybe. Suggestions welcome. From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 09 18:25:28 2024 Received: (at 71295) by debbugs.gnu.org; 9 Jun 2024 22:25:28 +0000 Received: from localhost ([127.0.0.1]:36173 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGQyc-0002EX-KS for submit@debbugs.gnu.org; Sun, 09 Jun 2024 18:25:28 -0400 Received: from wfhigh7-smtp.messagingengine.com ([64.147.123.158]:54379) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGQl2-0001cu-Og for 71295@debbugs.gnu.org; Sun, 09 Jun 2024 18:11:26 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.west.internal (Postfix) with ESMTP id 7315E18000B3; Sun, 9 Jun 2024 18:05:31 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Sun, 09 Jun 2024 18:05:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1717970731; x=1718057131; bh=Eg9gLah4is4m2IgIwoz+gXedgh8DygAlZKj29P4+PBE=; b= Qk6mXL2m5ZyK937PKCc1zwS+h0D+P8xl4sXTmqEUPNm94WKlDoMHzw0KhJEVyV7V AGIgNImfEb3ZfmM6qSq9pc6f0g2qWtxvNDzUFoXVcFGK3CQR+42AO0ORrLjWMznM x1g6mp3e4B5k31TYKlVWRlzfwfKlBsxFFWbur+9KzhqvzRY6304v708QGlKZYsDg Ny0Jc6GyfcsQyCjs58oeEDcdp4/uc+A4wDRSstDx9ujJ3DIxPiiRS6s8UjjikA1r VMYMX6JLy1aNzBfJ3kBm1WB2yvaFmjC1Wv2Fwy4YVbO9tzXHOnb+QJu0sx5Qb8s0 JCjuYiR29GvSS6X93CoTMA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1717970731; x= 1718057131; bh=Eg9gLah4is4m2IgIwoz+gXedgh8DygAlZKj29P4+PBE=; b=Y WXGvDm37qXDyswXtI4Ao0cWaMDOyahU9YKf+hjrE3QN+JyTj9PW1SvbPt2WAg5aH AkUO8tXycp3ezl2bnatzq4rK8YnEzpmN9Ih4kfagpW37F0n1P0B0BXpN+8rsRo4P WoN58AHsaLBvExwT2EhPxpfY3Yj+xrJBpZUSvFdUvAs/SJGkiS+jb6HE2lekPyoQ ypRSQkWEl5JpXRPh94vkVAWwIcTwp4VGjvSnZE3QpcgMwIDhxNcliY6fnYf0VrDt dupGjHU3GYEnqmxbt3Jj9P2vIbBNzcY2Aq0WDIZUU5dOXI4TlfwLDHqlZsWypO7j rmmAwcuSZ1OoLYnU2Cp4A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedtkedgtdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepveevudegtdeuueeugeefjeeludejhfeuvefgtddtteethfelgffhjefhffel teeknecuffhomhgrihhnpegsrggushhslhdrtghomhenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 9 Jun 2024 18:05:29 -0400 (EDT) Message-ID: Date: Mon, 10 Jun 2024 01:05:27 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#71295: 29.3; url-retrieve-synchronously does not timeout if initial connection hangs To: Eli Zaretskii References: <86bk4ko3lv.fsf@gnu.org> <19e5cb88-48a2-46a2-b9e9-c4a9c9198bb5@app.fastmail.com> <86plsuguzu.fsf@gnu.org> <86sexpff50.fsf@gnu.org> <362fabaa-0b96-42eb-8b97-b17a86a121cb@gutov.dev> <86r0d8dl08.fsf@gnu.org> <57c87a3e-d2bc-45aa-9c67-5ad62e82481f@gutov.dev> <86frtmbugm.fsf@gnu.org> Content-Language: en-US From: Dmitry Gutov In-Reply-To: <86frtmbugm.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71295 Cc: z@bcc32.com, 71295@debbugs.gnu.org, azeng@janestreet.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 09/06/2024 07:39, Eli Zaretskii wrote: >> Date: Sun, 9 Jun 2024 01:34:03 +0300 >> Cc:z@bcc32.com,71295@debbugs.gnu.org,azeng@janestreet.com >> From: Dmitry Gutov >> >> Thinking further, though, our ability to do so bring the existence of >> this variable into question (we only change it in >> url-retrieve-synchronously). >> >> I see it's been added as part of bug#26835 resolution, so maybe we'll >> need to re-examine that fix. > Maybe. Suggestions welcome. This seems to work: diff --git a/lisp/url/url.el b/lisp/url/url.el index 0ac2917b213..1972ff254fe 100644 --- a/lisp/url/url.el +++ b/lisp/url/url.el @@ -245,7 +245,8 @@ url-retrieve-synchronously data-buffer))) (start-time (current-time)) (proc-buffer (url-retrieve url callback nil silent - inhibit-cookies))) + inhibit-cookies)) + failed-message) (if (not proc-buffer) (url-debug 'retrieval "Synchronous fetching unnecessary %s" url) (unwind-protect @@ -276,6 +277,8 @@ url-retrieve-synchronously ;; Process sentinel vagaries occasionally cause ;; url-retrieve to fail calling callback. (unless data-buffer + (when (memq (process-status proc) '(signal failed)) + (setq failed-message (process-exit-status proc))) (url-debug 'retrieval "Dead process %s" url) (throw 'done 'exception)))) ;; Querying over consumer internet in the US takes 100 @@ -285,7 +288,9 @@ url-retrieve-synchronously (when (and data-buffer (not (eq data-buffer proc-buffer))) (let (kill-buffer-query-functions) - (kill-buffer proc-buffer))))) + (kill-buffer proc-buffer)))) + (when failed-message + (error "Retrieval failed: `%s'" failed-message))) data-buffer)) ;; url-mm-callback called from url-mm, which requires mm-decode. It's doesn't show the same kind of error like the nowait version: Debugger entered--Lisp error: (error "The x509 certificate does not match \"wrong.host.badssl.com\"") gnutls-boot(#> gnutls-x509pki (:complete-negotiation t :priority "NORMAL:%DUMBFW" :hostname "wrong.host.badssl.com" :loglevel 0 :min-prime-bits nil :trustfiles ("/etc/ssl/certs/ca-certificates.crt") :crlfiles nil :keylist nil :verify-flags nil :verify-error t :pass nil :flags nil :callbacks nil)) gnutls-negotiate(:process #> :type gnutls-x509pki :keylist nil :hostname "wrong.host.badssl.com") But the error is still meaningful: (error "Retrieval failed: ‘The Network Security Manager stopped the connections’") Unfortunately, the error is sometimes not triggered (the process object not created maybe?) - so some more investigation is needed.