What if files change while rsync is running?
Solution 1:
rsync first scans the files and builds a list. so once the file is listed for sync, rsync will sync the latest change of file. but if the file is not in the list of files to be synced, which was built before starting the sync operation, then it will not sync it.
Solution 2:
What happens if the files in the source directory are modified while rsync is running?
That depends if they are modified before rsync is running as well. As @Sachin said if they are not modified before the transfer then modifications during the transfer won't be picked up, however:
if you are modifying a file while it's being transferred, then probably the checksum will fail and it'll go round again. And if it goes around twice, and it still fails, then it prints a message saying; Error, checksum failed, file changed during transfer?