Add logic to fasClient to only write authorized_keys when necessary #2762
Labels
No labels
announcement
anubis
authentication
aws
backlog
blocked
bodhi
ci
cloud
communishift
copr
database
day-to-day
dc-move
deprecated
dev
discourse
dns
downloads
easyfix
epel
firmitas
forgejo_migration
Gain
High
Gain
Low
Gain
Medium
gitlab
greenwave
hardware
help wanted
high-trouble
koji
koschei
lists
low-trouble
medium-trouble
mirrorlists
monitoring
Needs investigation
odcs
OpenShift
ops
outage
packager_workflow_blocker
pagure
permissions
Priority
Needs Review
Priority
Next Meeting
Priority
🔥 URGENT 🔥
Priority
Waiting on Assignee
Priority
Waiting on External
Priority
Waiting on Reporter
rabbitmq
release-monitoring
releng
request-for-resources
s390x
security
SMTP
sprint-0
sprint-1
src.fp.o
staging
unfreeze
waiverdb
websites-general
wiki
Backlog Status
Needs Review
Backlog Status
Ready
chore
documentation
points
01
points
02
points
03
points
05
points
08
points
13
Priority
High
Priority
Low
Priority
Medium
Sprint Status
Blocked
Sprint Status
Done
Sprint Status
In Progress
Sprint Status
Review
Sprint Status
To Do
Technical Debt
Work Item
Bug
Work Item
Epic
Work Item
Spike
Work Item
Task
Work Item
User Story
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
infra/tickets#2762
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently, fasClient writes out authorized_keys for every user that can login to a box everytime it's called. On fedorapeople this is a lot of users and seems to be part of why fasClient takes a while to run there. We should try rewriting the code to compare what we would write out with what's currently in the authorized_key file. If they're the same then don't save the data. Then we should benchmark that this makes a difference. It should be faster unless read performance isn't substantially faster than write performance on the box for some reason.
Investigating.
From some benchmarking that i did, just changing the mode "w" to "a+" worths the change.
Even more if most files don't need to be changed.
The patch to do the trick the following:
{{{
--- fasClient 2012-02-02 23:48:43.000000000 +0000
+++ fasClient 2012-03-05 22:32:27.574346921 +0000
@@ -589,8 +589,10 @@
key = self.users[uid]['ssh_key']
if not os.path.exists(ssh_dir):
os.makedirs(ssh_dir, mode=0700)
}}}
ricky reviewed. Looks good!
ctria, I've added you to the gitfas group. So you should be able to commit this in about an hour. I'll be online on and off until next week (at pycon) -- ask around on #fedora-admin if you need help with cloning and pushing etc or try to ping me when I'm on there.
Thanks for sponsorship!
Committed and pushed. I didn't find any branches thus i pushed on master, i hope this doesn't break anything!