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

Specify a limit for the amount of simultaneous threads #370

Open
1 task done
ItsProfessional opened this issue Aug 29, 2023 · 11 comments
Open
1 task done

Specify a limit for the amount of simultaneous threads #370

ItsProfessional opened this issue Aug 29, 2023 · 11 comments
Labels
bug Something doesn't work as expected fixed in source Bug has been fixed in source-code, but has not been released yet priority I'm working on it, or will be soon

Comments

@ItsProfessional
Copy link

ItsProfessional commented Aug 29, 2023

Description

When upgrading a ton of modrinth mods, this error occurs. This only started to occur today, it was working fine yesterday.

Steps to reproduce

  1. Install a lot of mods from modrinth
  2. run "ferium upgrade"

Operating System

Linux

Are you using the latest version of ferium?

  • I am using the latest version of ferium

Additional Information

Command output:

$ ferium upgrade
Determining the Latest Compatible Versions

✓ Better Controls                             BetterControls-Fabric-1.20+v1.3.0.jar
✓ ARRP                                        arrp-0.8.0.jar
✓ Debrand                                     debrand-1.1.1.jar
✓ Elytra/Chestplate Swapper (Fabric)          elytra-chestplate-swapper-1.3.0-MC1.20.jar
✓ 'Slight' Gui Modifications                  slight-gui-modifications-2.6.1.jar
✓ Cloth Config API (Fabric/Forge)             cloth-config-11.1.106-fabric.jar
✓ Architectury API (Fabric/Forge)             architectury-9.1.12-fabric.jar
✓ AppleSkin                                   appleskin-fabric-mc1.20-2.5.0.jar
✓ Ash API                                     ash_api-quilt-3.0.2+1.20.1.jar
✓ Better Ping Display [Fabric]                BetterPingDisplay-Fabric-1.20.1-1.1.1.jar
✓ Architectury API                            architectury-9.1.12-fabric.jar
✓ Armor Chroma for Fabric                     armorchroma-1.2.6.jar
✓ CraterLib                                   CraterLib-fabric-1.20-1.0.2.jar
✓ Enhanced Attack Indicator                   enhanced_attack_indicator-1.0.4+1.20.jar
✓ Animatica                                   animatica-0.6+1.20.jar
✓ Boosted Brightness                          boosted-brightness-2.2.0+1.20.1.jar
✓ Better Suggestions                          better-suggestions-1.20.1-1.1.1.jar
✓ Clean F3                                    CleanF3-0.4.0-mc1.20.jar
✓ Better Eating Mod                           BetterEatingMod-0.4.0.jar
✓ Better Taskbar                              bettertaskbar-fabric-mc1.20-1.7.0.jar
✓ Capes                                       capes-1.5.2+1.20-fabric.jar
✓ CleanCut                                    cleancut-fabric-6.0+mc1.19.1-mc1.20.x.jar
✓ 3D Skin Layers                              3dskinlayers-fabric-1.5.4-mc1.20.1.jar
✓ bad packets                                 badpackets-fabric-0.4.1.jar
✓ ChatWalk                                    chatwalk-1.0.2.jar
✓ Better Resource Pack Sorting                better_resource_pack_sorting-mc1.20-1.0.0-build.3.jar
✓ Blanket                                     blanket-client-tweaks-1.1.4.jar
✓ AntiGhost                                   antighost-1.20-fabric0.83.0-1.1.5.jar
✓ Borderless Mining                           borderless-mining-1.1.8+1.20.1.jar
✓ Better Mount HUD                            bettermounthud-1.2.2.jar
✓ CompleteConfig                              completeconfig-2.5.0.jar
✓ Boat Item View                              Boat-Item-View-Fabric-1.20.1-0.0.5.jar
✓ ClearDespawn                                ClearDespawn-fabric-1.20.1-1.1.13.jar
✓ Continuity                                  continuity-3.0.0-beta.3+1.20.1.jar
✓ ClickThrough                                clickthrough-1.20-fabric0.83.0-0.4.1.jar
✓ Better Advancements                         BetterAdvancements-Fabric-1.20.1-0.3.2.161.jar
✓ Camera Utils                                camerautils-1.20.1-1.0.5.jar
✓ Blocked server bypass for Fabric            mc-blacklist-bypass-1.0.3-1.20.1.jar
✓ Command Block IDE                           command-block-ide-0.4.3.jar
✓ Delete Worlds To Trash                      DeleteWorldsToTrash-v8.0.0-1.20.1-Fabric.jar
✓ Better Sodium Video Settings Button         bsvsb-3.0.3.jar
✓ Compact Chat                                compact-chat-2.0.2.jar
✓ Better Recipe Book                          brb-1.8.0-fabric.jar
✓ Better Nether Map                           nethermap-3.0.0-1.20.1.jar
✓ Axolotl Buckets                             axolotlbuckets-1.2.0+1.20.jar
✓ CalcMod                                     calcmod-1.2.0.jar
✓ Disable Custom Worlds Advice                DisableCustomWorldsAdvice-4.1.jar
✓ Amecs                                       amecs-1.3.9+mc.1.20.1.jar
✓ e4mc                                        e4mc-4.0.1+1.19.4-fabric.jar
✓ Auth Me                                     authme-7.0.2+1.20.jar
✓ Cloth Config API                            cloth-config-11.1.106-fabric.jar
✓ Litematica                                  litematica-fabric-1.20.1-0.15.3.jar
✓ MaLiLib                                     malilib-fabric-1.20.1-0.16.2.jar
✓ Blur (Fabric)                               blur-3.1.0.jar
✓ MiniHUD                                     minihud-fabric-1.20.1-0.27.0.jar
✓ Nicephore (better screenshots) [Fabric]     nicephore-fabric-1.19.3-1.0.1.jar
✓ Dynamic Crosshair                           dynamiccrosshair-7.0.4+1.20-fabric.jar
✓ clientcommands                              clientcommands-2.8.3.jar
✓ [EMF] Entity Model Features                 entity_model_features_fabric_1.20-0.2.13.jar
✓ Debugify                                    Debugify-1.20.1+2.0.jar
✓ DashLoader                                  dashloader-5.0.0-beta.2+1.20.0.jar
✓ Chat Heads                                  chat_heads-0.10.20-fabric-1.20.jar
✓ BetterF3                                    BetterF3-7.0.1-Fabric-1.20.1.jar
✓ Carpet Extra                                carpet-extra-1.20-1.4.115.jar
✓ CIT Resewn                                  CITResewn-1.1.3+1.20.jar
✓ CreativeCore                                CreativeCore_FABRIC_v2.10.28_mc1.20.1.jar
✓ Better Runtime Resource Pack (BRRP)         brrp-fabric-1.0.1-1.20.1.jar
✓ Ambient Environment                         AmbientEnvironment-fabric-1.20.1-11.0.0.1.jar
✓ Carpet-Fixes                                carpet-fixes-1.20-1.16.1.jar
✓ Dynamic Crosshair Compat                    dynamiccrosshair-compat-3.3+1.20.1.jar
✓ Better Statistics Screen                    betterstats-2.10.3+1.20.1.jar
✓ Carpet                                      fabric-carpet-1.20-1.4.112+v230608.jar
✓ Enhanced Block Entities                     enhancedblockentities-0.9+1.20.jar
✓ FabricSkyboxes                              fabricskyboxes-0.7.2+mc1.20.1.jar
✓ Entity Culling                              entityculling-fabric-1.6.2-mc1.20.jar
✓ Exordium                                    exordium-fabric-1.1.4-mc1.20.1.jar
✓ Equipment Compare                           EquipmentCompare-1.20.1-fabric-1.3.7.jar
✓ Force-Port-Mod                              forceport-1.1.0.jar
✓ Fast Items                                  fastitems-1.0.0-mc1.20.1.jar
✓ GamemodeOverhaul                            gamemodeoverhaul-fabric-2.2.0+1.20.1.jar
✓ Fabrishot                                   fabrishot-1.10.0.jar
✓ Hide Hands                                  hidehands-1.20.1-4.0.jar
✓ Hold That Chunk                             holdthatchunk-2.0.1+1.19.jar
✓ FastQuit                                    fastquit-3.0.0-beta.2+1.20+.jar
✓ Game Menu Remove GFARB                      gamemenuremovegfarb-fabric-mc1.19.4-2.1.2.jar
✓ Held Item Info                              held-item-info-1.5.0.jar
✓ FerriteCore                                 ferritecore-6.0.0-fabric.jar
✓ Falling Leaves                              fallingleaves-1.15.2+1.20.1.jar
✓ Full Brightness Toggle                      fullbrightnesstoggle-1.20.1-3.0.jar
✓ FabricSkyBoxes Interop                      fsb-interop-1.3.4+mc1.20-build.47.jar
✓ Fadeless                                    fadeless-1.0.1.jar
✓ Ksyxis                                      Ksyxis-1.1.jar
✓ Inspecio                                    inspecio-1.8.1+1.20.jar
✓ Krypton                                     krypton-0.2.3.jar
✓ Fast Portals                                fast-portals-1.0.3.jar
✓ Methane                                     Methane - 2.1.jar
✓ MixinTrace                                  mixintrace-1.1.1+1.17.jar
✓ Make Minecraft Music Great Again            mmcmga-1.20.1-1.0.jar
✓ Lithium                                     lithium-fabric-mc1.20.1-0.11.2.jar
✓ Horse Stats Vanilla                         horse-stats-vanilla-4.3.0.jar
✓ Memory Usage Screen                         memoryusagescreen-fabric-mc1.20-1.9.0.jar
✓ InvMove                                     InvMove-1.20-0.8.4-Quilt.jar
✓ Indium                                      indium-1.0.25+mc1.20.1.jar
✓ LambDynamicLights                           lambdynamiclights-2.3.1+1.20.1.jar
✓ Improved Fire Overlay                       improved-fire-overlay-1.20.1-v3.jar
✓ [ETF] Entity Texture Features               entity_texture_features_fabric_1.20-4.5.1.jar
✓ Make Bubbles Pop                            make_bubbles_pop-0.2.0-fabric-mc1.19.4+.jar
✓ MidnightLib                                 midnightlib-quilt-1.4.1.1.jar
✓ Collective                                  collective-1.20.1-6.65.jar
✓ Mixin Conflict Helper                       MixinConflictHelper-1.2.0.jar
✓ Model Gap Fix                               modelfix-1.14-fabric.jar
✓ Iceberg                                     Iceberg-1.20.1-fabric-1.1.15.jar
✓ Log Begone                                  Log-Begone-Fabric-1.20.1-1.0.8.jar
✓ Enchantment Descriptions                    EnchantmentDescriptions-Fabric-1.20.1-17.0.4.jar
✓ Tweakeroo                                   tweakeroo-fabric-1.20.1-0.17.1.jar
✓ Name Pain                                   namepain-1.5.2 fabric-1.20.x.jar
✓ Monsters in the Closet                      monsters-in-the-closet-1.0.3+1.20.jar
✓ NBT Autocomplete                            NBTac-FABRIC-1.20.1-1.1.4.jar
✓ More Culling                                moreculling-1.20-0.18.1.jar
✓ MoreChatHistory                             morechathistory-1.19.1-1.1.1.jar
✓ Moonlight Lib                               moonlight-1.20-2.8.12-fabric.jar
✓ Freecam (Modrinth Edition)                  freecam-fabric-modrinth-1.2.1+1.20.jar
✓ Forge Config API Port                       ForgeConfigAPIPort-v8.0.0-1.20.1-Fabric.jar
error sending request for url (https://api.modrinth.com/v2/project/fM515JnW/version): http2 error: stream error received: refused stream before processing any application logic
@ItsProfessional ItsProfessional added the bug Something doesn't work as expected label Aug 29, 2023
@ItsProfessional
Copy link
Author

Temporary workaround:
I made a patch to add a 50ms delay between checking each mod
0001-sleep.patch.txt

@theRookieCoder
Copy link
Collaborator

theRookieCoder commented Aug 30, 2023

This issue is caused by too many requests being made simultaneously, and is sometimes a result of a flaky internet connection. Instead of adding a delay, it should also be possible to decrease the number of threads created (75 by default).
When resolving latest versions:

let semaphore = Arc::new(Semaphore::new(75));

When downloading mods:
let semaphore = Arc::new(Semaphore::new(75));

@ItsProfessional
Copy link
Author

ItsProfessional commented Aug 30, 2023

Can you add an option to change that hardcoded 75 value as a command line flag in the next version?

@owosoup
Copy link

owosoup commented Sep 2, 2023

Same issue here; it's made the whole program useless. How did you apply that temporary workaround? Did you recompile after editing the code?

@owosoup
Copy link

owosoup commented Sep 2, 2023

Nevermind, I figured it out! First time compiling something on rust :)

@theRookieCoder theRookieCoder changed the title http2 error: stream error received: refused stream before processing any application logic Allow user to specify a limit for the amount of simultaneous threads Sep 3, 2023
@theRookieCoder theRookieCoder changed the title Allow user to specify a limit for the amount of simultaneous threads Specify a limit for the amount of simultaneous threads Sep 3, 2023
@Gryzle
Copy link

Gryzle commented Sep 3, 2023

Can we expect a patched release soon? I installed using Homebrew and integrated it into automation and therefore can only use a release available from Homebrew.

@Gryzle
Copy link

Gryzle commented Sep 4, 2023

I managed to build from source and limit the threads both in the source files and using the "-t" attribute, but am still getting the error ONLY when using "ferium upgrade." Exact command:
ferium -t 1 upgrade

Are there any solutions to this? It can't even download one mod at a time. Listing mods with verbose works, but upgrading does not.

EDIT: I found that the current limit is 64 mods (ironic) from Modrinth. I'm not sure how to implement the cooldown, and limiting the threads does not work for me. I am on macOS (I know, calm down- it's what I have).

@ItsProfessional
Copy link
Author

are you sure you're using the compiled build? your comment only shows "ferium", without any path. Which means (not sure about mac, but on linux) it will just use the one from your system path, i.e. from your package manager.

@ItsProfessional
Copy link
Author

ItsProfessional commented Sep 4, 2023

I found that the current limit is 64 mods

False. It only started happening for me on about 120 mods iirc.

@Gryzle
Copy link

Gryzle commented Sep 4, 2023

For me, it was 64 mods, tested on two computers, both running macOS Ventura, one using the latest released version of ferium, and the other using a current compiled version.

@Gryzle
Copy link

Gryzle commented Sep 4, 2023

are you sure you're using the compiled build? your comment only shows "ferium", without any path. Which means (not sure about mac, but on linux) it will just use the one from your system path, i.e. from your package manager.

I compiled it using Homebrew. I verified that it was using the latest version and modified thread limit I put in place of 25 directly in the code.

thomhayward added a commit to thomhayward/ferium that referenced this issue Oct 1, 2024
Acquire a semaphore permit while executing each download task, instead
of while _creating_ each download task.

- Fixes gorilla-devs#370.
- Also prevents a deadlock when downloading more than 75 mods.
@theRookieCoder theRookieCoder reopened this Oct 2, 2024
@theRookieCoder theRookieCoder added the priority I'm working on it, or will be soon label Oct 2, 2024
@theRookieCoder theRookieCoder added the fixed in source Bug has been fixed in source-code, but has not been released yet label Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something doesn't work as expected fixed in source Bug has been fixed in source-code, but has not been released yet priority I'm working on it, or will be soon
Development

No branches or pull requests

4 participants