A theorem of Nosal and Nikiforov states that if G is a triangle-free graph with m edges, then lambda(G)<=root m, where the equality holds if and only if G is a complete bipartite graph. A well-known spectral conjecture of Bollob & aacute;s and Nikiforov [J. Combin. Theory Ser. B 97 (2007)] asserts that if G is a Kr+1-free graph with m edges, then lambda(2)(1)(G)+lambda(2)(2)(G)<=(1-(1)/(r))2m. Recently, Lin, Ning and Wu [Combin. Probab. Comput. 30 (2021)] confirmed the conjecture in the case r=2. Using this base case, they proved further that lambda(G)<=root m-1for every non-bipartite triangle-free graph G, with equality if and only if m=5 and G=C-5. Moreover, Zhai and Shu [Discrete Math. 345 (2022)] presented an improvement by showing lambda(G) <= beta(m), where beta(m) is the largest root of Z(x) := x(3)-x(2)-(m(-2))x+m(-3). The equality in Zhai--Shu's result holds only if m is odd and G is obtained from the complete bipartite graph K-2,m-1/2 by subdividing exactly one edge. Motivated by this observation, Zhai and Shu proposed a question to find a sharp bound when m is even. We shall solve this question by using a different method and characterize three kinds of spectral extremal graphs over all triangle-free non-bipartite graphs with even size. Our proof technique is mainly based on applying Cauchy interlacing theorem of eigenvalues of a graph, and with the aid of a triangle counting lemma in terms of both eigenvalues and the size of a graph.