MILWAUKEE — The work of relievers is generally only glaring when they don’t do their jobs perfectly, so most of the seven red-hot Giants in the bullpen have flown under the radar in the second half.

The bullpen entered this series with a 1.21 ERA since the All-Star break and 22﻿2/3 consecutive scoreless innings, but one mistake by Jean Machi led to the decisive run in a 4-3 loss to the Milwaukee Brewers on Tuesday. With the teams tied in the seventh, Machi hung a two-out changeup to Gerardo Parra that was skied over the right-field wall.

“He just left that pitch up,” manager Bruce Bochy said. “Shoot, it’s hard to do what they’ve been doing. They’ve been really good, and today Machi gave up a run. He’s been as good as anybody down there. With two outs, none on, that hurt.”

The first three Brewers runs came off the bat of Carlos Gomez, the gifted All-Star center fielder who can hurt you any number of ways. Starter Tim Lincecum struck out four in the first two innings, but he gave up a two-out single to opposing pitcher Jimmy Nelson in the third and then hung a first-pitch slider to Gomez. He unloaded, hitting a two-run homer.

Rickie Weeks hit a leadoff double in the fifth before Lincecum got two more strikeouts. A wild pitch sent Weeks to third, and Gomez bunted the next pitch down the third-base line, reaching first easily as Weeks scored.

“That caught both of us by surprise,” Lincecum said of himself and Pablo Sandoval, neither of whom was in a spot to make a throw to first. “It was a nice bunt.”

The Giants struck back in the top of the sixth with a rally that started with Joe Panik’s fifth hit in two games. Brandon Belt doubled off the wall in left-center, putting two runners in scoring position for Sandoval, who had 13 hits in his previous 25 at-bats, with a runner on second or third. He blasted a 0-2 fastball out to right, tying the game.

After Parra’s homer, Bochy pushed all his chips to the middle in the top of the eighth. Sandoval walked and Michael Morse did as well while hitting for center fielder Gregor Blanco. With two outs, Bochy replaced left fielder Juan Perez with Buster Posey, who had been given a day off.

With no outfielders remaining on the bench, Bochy knew he would have to get creative in the bottom of the inning. But he took his chances.

“We’re down, so I’m going to put my bats up there,” he said. “I’ll worry about the other part later.”

Later came too soon. Posey worked the count to 3-2 before whiffing on a filthy curveball from Jeremy Jeffress. Posey went to first in the bottom of the inning with Belt shifting to right field for the first time since 2011. Hunter Pence moved over to center field for the first time since 2007, his rookie year. The Brewers didn’t hit a ball in the air.

The Giants threatened again in the top of the ninth. Pence drewa a two-out walk, and Panik hit a slow roller to second and beat the throw to first, according to first base umpire Hal Gibson. The Brewers challenged the play, and after three minutes and 17 seconds, Panik was called out.

“I didn’t think they were going to overturn it,” Bochy said. “I just don’t see how that got overturned. It was so close. You always hear the word ‘conclusive.’ But they did, and that’s the game.”

Matt Cain held his left arm straight out and everything looked normal. Then he held his right arm out, and it wouldn’t fully extend. Cain said his pitching arm has been like that since high school, and it’s never been an issue. But last month, Cain lost even more range of motion, and enough was enough. He’ll have surgery Monday to remove bone chips from his elbow, ending his season.

“It came down to, really my body wouldn’t let me do it,” he said. “I lost too much range of motion in my arm. It would have hurt to throw. I would have lost stuff, too. It was just time. They’ve been in there a long time.”

Cain said his body adapted to the diminished range of motion. He pitched well for years, but his ERA went up to 4.00 last season and 4.18 this season. Did the bone chips lead to the below-average numbers?

“No, I don’t believe that,” Cain said firmly. “A lot of it was making bad pitches and not executing.”

Cain said that even after the fragments are removed, he won’t be able to fully straighten his right arm. That kind of range of motion has been gone for too many years, but Cain is still looking forward to being healthier for the 2015 season.

“It’s nice knowing I’ll go into next year with everything good to go,” he said. “I won’t be worrying.”

Otto Warmbier was arrested in January 2016 at the end of a brief tourist visit to North Korea. He had been medically evacuated and was being treated at the University of Cincinnati Medical Center when he died at age 22.