I was testing an old power supply(didn't work!) which have EMI filter caps on the inputs, when I disconnected the power source (220v AC), I touched the plug metal parts and I got an electric shock.so,what does that mean? Are they charged by the ac input ? Do the caps need a parallel resisor to discharge or there is a fault in the circuit that doesn't provide a path for that current?
Capacitors that are connected to AC are continuously charged and discharged with polarity reversing as the AC voltage reverses. When they are disconnected they may remain charged with one polarity or the other depending on the instant in the AC cycle that they are disconnected. Filter capacitors may have a small value of capacitance and thus not store a dangerous level of energy even though you can feel the shock. In that case, they don't require a discharge resistor.