4 ms·
You're going to leave us hanging with the Photos story?
by k2enemy 4y ago
You're going to leave us hanging with the Photos story?
- JKCalhoun 4y agoI guess I have to reply now. A feature was tossed in my lap for Photos. I think AppKit had added something new — maybe file handlers or something — and I was to wrap the photo export (for desktop Photos) with file handler calls. Sort of lock access to the file while writing, unlocking after — something like that. I knocked it out rather fast but was told not to check it into the "master" branch for some reason — maybe they were trying to get some kind of stable branch for QA to test, I don't remember. In any event, the code sat in a branch and I went about other features. Somehow months go by and suddenly we're about to ship when someone says, "Hey, where's the file locking?" Oh shit! Well, I knew to check it in this late in the game (we had already done full suite testing etc.) was wildly irresponsible. The code was untested, I expected we would find an issue here or there. But I was told by management, nope, check it in. Somehow we needed that feature in that release of Photos. Well, it didn't work. The export code was wildly threaded and ping-ponged between background processes. It was not easy code to wrap your head around. For some reason one of the managers already had it in for me and it started to become clear to me that this was a kind of do-or-die moment for me. In fact, I rather think he hoped I would fail so he could give me the boot. I confess a full on panic took a hold of me and I started experiencing levels of anxiety I had never experienced in my entire life. An engineer in Finland (I think he worked on AppKit) became my only life line. Or rather I should say he became my "smart friend". I put in consecutive 18 hours days, teleconferencing to Finland, trying to unwrap the mess that was my export code. And as I recall, another one of the truly genius engineers that I was lucky enough to work with made some casual remark to me along the lines of: "File handles have a bug: they store data in the thread you create them on, if you try to tear down a file handler on a different thread it crashes. The only way to guarantee you create and tear down the file handler on the same thread is to dispatch to the main thread before creation/teardown." So easy for smart people. Yeah, I survived again but I immediately looked for another team. The anxiety lingered I think for months after. (Thank you, Leo, again, for pulling me over to your team and maybe even saving my life — it was a weird thing that I needed major intestinal surgery not long after the Photos ordeal.)
- k2enemy 4y agoThanks for following up! A good story -- sorry you had to go through the stress though.