PHOENIX — Camilo Doval went down as the winning pitcher Wednesday, but he wasn’t at all happy about his night. 

He yelled angrily into his glove after the ninth inning and screamed passionately after the final out of the 10th. When reporters asked him to sum it all up later, his face told the story. 

This was a rough night. It was also one when he dug deep, showing a necessary second wind to help the Giants escape with a messy 6-5 win over the Arizona Diamondbacks

It was classic “torture” baseball. Doval gave up a two-run homer to Ketel Marte in the ninth, blowing the remainder of what had been a 5-2 lead after the top of the eighth. But after Patrick Bailey’s sac fly brought home the automatic runner in the 10th, Doval went back for three more outs. He struck out a pair with the tying run on third. 

Doval had not pitched two full innings in three years, but because of the recent losing streak, he also had not touched the mound in five days. He was fresh, and when the Giants retook the lead, he asked manager Bob Melvin for the ball and one more inning.

“My thought was that what happened, happened,” he said through interpreter Erwin Higueros. “It was a brand new inning and I’ve got to get the job done now.”

Melvin didn’t have a lot of other choices at that point, anyway. Joey Lucchesi, who arrived just a few weeks ago and doesn’t have a big league save, was warming up just in case. 

“I probably was as impressed with him as I’ve been all year, going back out there and leaving the (automatic) runner out there,” Melvin said. “I know he ends up (giving up) the homer and that didn’t feel too terribly good. To be able to respond from that and go out there and keep your wits about you — and his stuff was even better in the (10th) — it was impressive.”

Big picture, the decision-making was fascinating. Former closer Ryan Walker, who had a rough Sunday, was nowhere to be found. Spencer Bivens moved into a high-leverage role and helped get the lead to the ninth after Erik Miller got Landen Roupp out of a serious jam. Melvin also used Randy Rodriguez, who got out of his own tight spot, and Tyler Rogers, who allowed an unearned run in the eighth. 

When the Giants moved Doval back to the closer role, he was throwing as well as anybody in baseball. It seemed like a decision that would make the best statistical bullpen in baseball even stronger, but Walker is still searching for his old form as a setup man, and Doval has allowed multiple runs in three of his last four appearances. 

Rodriguez continues to pitch like someone who should be named to the All-Star team on Sunday, but the Giants want to be careful with his workload, and he isn’t often available to pitch back-to-back games. All of a sudden, there are cracks showing in the bullpen, and the timing isn’t great. The offense is mired in a deep slump and the rotation hasn’t been as strong as it looked earlier this season. 

There are a lot of concerns with the Giants at the moment, but none of that mattered in the aftermath of Doval recording his sixth out. Players gathered around a clubhouse TV to watch the end of the Dodgers-White Sox game and the victory soundtrack blasted through the room as Melvin spoke to reporters. They’ll send Robbie Ray to the mound Wednesday in search of what would be a solid series split. 

“The middle innings weren’t great for us, but then to respond after we give up a couple runs and lose the lead with guys that we’re really confident about finishing the game, I thought that was impressive,” Melvin said of the second win of the road trip. “Especially during this stretch where we’ve been beaten quite a bit.”

Download and follow the Giants Talk Podcast