Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support not using bug-reference-mode in remote files #703

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

bramadams
Copy link
Contributor

Fixes a similar issue as magit/magit#5222, where, when using tramp, forge would do substantial unnecessary work inside forge-bug-reference-setup, slowing down the connection or even hanging.

To fix this issue, changes similar to the original magit commit (see magit/magit@61c051e) could easily be repeated, basically shortening out the unless within forge-bug-reference-setup.

@tarsius
Copy link
Member

tarsius commented Sep 17, 2024

Respecting auto-revert-remote-files in forge-bug-reference-setup

auto-revert-remote-files purpose is to control an unrelated feature, and should not be repurposed here.

when using tramp, forge would do substantial unnecessary work

What part is expensive? Did you do some benchmarking?

I don't think it is "unnecessary" in the same way as was the case for magit/magit#5222. This does cause bug-references to be by "linkified", doesn't it? Doing that might be too expensive to be worth it, but "unnecessary" doesn't seem like the appropriate term, unless I am missing something.

Can you say more about the hanging? Why does that happen? Does that actually happen, or is the process just so slow, that you always abort before it completes?

@bramadams
Copy link
Contributor Author

bramadams commented Sep 17, 2024

Thanks for checking this PR!

For a given remote file, it basically hangs for at least a minute, before I manually abort. Then, if I try to open the same file again, it opens immediately. When trying a different file, the second try would work again.

Neither of these files are inside a git repository, just a regular folder where I have read/write access. When invoking tramp to access those files, I'm also not inside any local git repository. As such, it seems unnecessary for forge to jump in.

Earlier today, I made a screenshot of the stack trace after sending a SIGUSR2 to emacs while it was hanging, see attached. That's where I noticed forge-bug-reference-setup. Also, if I toggle the new variable forge-bug-reference-remote-files to nil, the hanging disappears.

stack_trace

@bramadams
Copy link
Contributor Author

@tarsius Just a heads-up that I've rebased the PR up to forge 0.4.5. I can confirm that the PR has been working perfectly for the past 3 months (no more hangs), both on 29.x and the latest 30.x pretest. Is it possible to merge this?

@tarsius tarsius changed the title Respecting auto-revert-remote-files in forge-bug-reference-setup Support not using bug-reference-mode in remote files Dec 23, 2024
This is done for performance reasons, see magit#703.

Because the maintainer is not entirely convinced this is necessary,
this is a regular variable instead of a user option for now.
@tarsius tarsius merged commit 8bace81 into magit:main Dec 23, 2024
7 checks passed
@tarsius
Copy link
Member

tarsius commented Dec 23, 2024

Happy new year!

@bramadams
Copy link
Contributor Author

Thanks a lot, and happy holidays to you too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants