Skip to content

Don't rebuild HTTP session with no connections#1020

Open
martindurant wants to merge 1 commit intofsspec:mainfrom
martindurant:no_rebuild
Open

Don't rebuild HTTP session with no connections#1020
martindurant wants to merge 1 commit intofsspec:mainfrom
martindurant:no_rebuild

Conversation

@martindurant
Copy link
Copy Markdown
Member

Fixes #1019

@martindurant
Copy link
Copy Markdown
Member Author

@Koncopd , latest aiobotocore doesn't like that; but I'm not sure why we are getting an unstarted session the second time around.

@martindurant
Copy link
Copy Markdown
Member Author

Given that there isn't much cost to "rebuilding" the http_sessions without any actual live sessions, and that it only happens once, I think it's not worth trying to prob aiobotocore in the right direction here. What do you think, @Koncopd ?

@Koncopd
Copy link
Copy Markdown

Koncopd commented Apr 20, 2026

As I said, my problem is that rebuilding aiobotocore session (not http sessions) erases the credentials I pass. And if I provide a session, it should not happen that I just lose it on set_session.

@Koncopd
Copy link
Copy Markdown

Koncopd commented Apr 20, 2026

Here I mean

self.session = aiobotocore.session.AioSession(**self.kwargs)

@Koncopd
Copy link
Copy Markdown

Koncopd commented Apr 20, 2026

Btw the failing test (test_session_close) looks strange to me, it runs run_program(run) with True and False, but run parameter doesn’t seem to be passed anywhere inside run_program. I assume it just runs the same code, but fails on the second execution only, so the problem is probably due to caching.

@martindurant
Copy link
Copy Markdown
Member Author

it just runs the same code, but fails on the second execution only

Yes, that is exactly the idea. If I remember, the variable is there to allow a breakpoint in the function, where we know which invocation we are on.

@Koncopd
Copy link
Copy Markdown

Koncopd commented Apr 22, 2026

Thank you, i will try to check the problem later.

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.

s3fs>=2026.2.0 always rebuilds the session

2 participants