When I used second curtain sync on my Canon DSLR, I noticed that the camera flashes twice: once when the shutter opens and the other time when the shutter is about to close. (I noticed that because I was using long exposures.) Why is this happening? Is it a problem?
The first flash is part of the eTTL system. The camera is using it to establish the exposure. If you switch to manual flash mode it will not happen (but you will have to fix the exposure yourself). This initial flash occurs before the shutter opens and does not affect exposure, but is rather used to measure the light as part of the metering processed.
You should also be aware that even when not using second curtain sync, but still using eTTL the flash is firing twice, but the delay between the flashes is much shorter, so you are not seeing it.
The first flash is a metering flash done just before the shutter opens when you are using E-TTL to automatically compute the amount of power used by the flash. With E-TTL II this allows the camera to combine the distance info from focusing with the amount of light returned from the metering flash. This allows the reflectivity of the subject to be taken into account when computing the needed power provided by the flash to accomplish optimal exposure. The metering flash, in fact, predates the use of distance information provided by the focus system by several generations of TTL technology.
One nice thing about the Canon E-TTL system is that it will properly compute the needed flash power even when you are using Manual shooting mode. Flash Exposure Compensation is also active and may be used when in Manual shooting mode. If you don't want the metering flash to fire, you can choose to use the flash in manual flash mode and set the power on the flash yourself. Be aware that if your subject distance changes or if the reflectivity of your subject changes you will need to adjust the flash power.